title: Can't open serial connection in Pyserial: "termios.error: (22, 'Invalid argument') "
body: <p>I'm having problem executing the following code: </p>
  
  <pre><code>import serial
  
  ser = serial.Serial(
      port='/dev/tty.FireFly-16CB-SPP',
      baudrate=115200,
      #parity=serial.PARITY_ODD,
      stopbits=serial.STOPBITS_ONE,
      bytesize=serial.EIGHTBITS
  )
  
  ser.open()
  ser.isOpen()
  </code></pre>
  
  <p>This worked yesterday, and I don't know what I changed. Now I get the following error message:</p>
  
  <pre><code>    Traceback (most recent call last):
    File "main.py", line 32, in &lt;module&gt;
      bytesize=serial.EIGHTBITS
    File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/serial/serialutil.py", line 260, in __init__
      self.open()
    File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/serial/serialposix.py", line 280, in open
      self._reconfigurePort()
    File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/serial/serialposix.py", line 409, in _reconfigurePort
      termios.tcsetattr(self.fd, TERMIOS.TCSANOW, [iflag, oflag, cflag, lflag, ispeed, ospeed, cc])
  termios.error: (22, 'Invalid argument')
  </code></pre>
  
  <p>I'm a complete beginner to Python, and can't decipher the error message above. I've tried reinstalling Pyserial, but that didn't fix the error. What is wrong?</p>