TypeError in SerialException
Brought to you by:
cliechti
Trying to catch a SerialException while reading from the serial port, I get
...
File "/usr/lib/python3.4/codecs.py", line 488, in read
newdata = self.stream.read(size)
File "/usr/lib/python3.4/site-packages/serial/serialposix.py", line 480, in read
if e[0] != errno.EAGAIN:
TypeError: 'SerialException' object does not support indexing
In current trunk version this is line 498 in pyserial/serial/serialposix.py which is causing this:
498 if e[0] != errno.EAGAIN:
499 raise SerialException('read failed: %s' % (e,))
I guess it should be
498 if e.errno != errno.EAGAIN:
499 raise SerialException('read failed: %s' % (e,))
fixed in trunk where the exeption is handled differently for python 2.x and python 3.x