Please read this before reporting a bug:
https://wiki.archlinux.org/title/Bug_reporting_guidelines
Do NOT report bugs when a package is just outdated, or it is in the AUR. Use the 'flag out of date' link on the package page, or the Mailing List.
REPEAT: Do NOT report bugs for outdated packages!
https://wiki.archlinux.org/title/Bug_reporting_guidelines
Do NOT report bugs when a package is just outdated, or it is in the AUR. Use the 'flag out of date' link on the package page, or the Mailing List.
REPEAT: Do NOT report bugs for outdated packages!
FS#42446 - [python-pyserial] Wrong variables in setXON()
Attached to Project:
Community Packages
Opened by Rieger Anton (seishinryohosha) - Sunday, 19 October 2014, 16:17 GMT
Last edited by Sergej Pupykin (sergej) - Friday, 27 February 2015, 11:56 GMT
Opened by Rieger Anton (seishinryohosha) - Sunday, 19 October 2014, 16:17 GMT
Last edited by Sergej Pupykin (sergej) - Friday, 27 February 2015, 11:56 GMT
|
DetailsDescription:
The setXON() Method for Posix-Systems is wrong impelemented. Two variables are wrong. Additional info: Error Message: Traceback (most recent call last): File "<stdin>", line 1, in <module> File "/usr/lib/python3.4/site-packages/serial/serialposix.py", line 622, in setXON if not self.hComPort: raise portNotOpenError AttributeError: 'Serial' object has no attribute 'hComPort' Steps to reproduce: Use the setXON() Method. Solution: Change the variables in /usr/lib/python3.4/site-packages/serial/serialposix.py to the correct ones. hComPort -> _isOpen enable -> level Here is the Diff: --- serialposix.py 2014-10-19 18:10:18.890542515 +0200 +++ serialposix-patched.py 2014-10-19 18:13:42.680841412 +0200 @@ -272,7 +272,7 @@ class PosixSerial(SerialBase): - """Serial port class POSIX implementation. Serial port configuration is + """Serial port class POSIX implementation. Serial port configuration is done with termios and fcntl. Runs on Linux and many other Un*x like systems.""" @@ -619,8 +619,8 @@ This will send XON (true) and XOFF (false) to the other device. WARNING: this function is not portable to different platforms! """ - if not self.hComPort: raise portNotOpenError - if enable: + if not self._isOpen: raise portNotOpenError + if level: termios.tcflow(self.fd, TERMIOS.TCION) else: termios.tcflow(self.fd, TERMIOS.TCIOFF) @@ -676,7 +676,7 @@ # handled below buf = os.read(self.fd, size - len(read)) read.extend(buf) - if ((self._timeout is not None and self._timeout >= 0) or + if ((self._timeout is not None and self._timeout >= 0) or (self._interCharTimeout is not None and self._interCharTimeout > 0)) and not buf: break # early abort on timeout return bytes(read) The patch is also attached. |
This task depends upon
Comment by Doug Newgard (Scimmia) -
Sunday, 19 October 2014, 16:45 GMT
Not a packaging problem, sounds like something that needs to go upstream.
Comment by Rieger Anton (seishinryohosha) -
Monday, 20 October 2014, 10:37 GMT
Sure, I've been unsure in this category.
Comment by Sergej Pupykin (sergej) -
Thursday, 26 February 2015, 17:40 GMT
please report it to python-pyserial developers at http://sourceforge.net/p/pyserial/_list/tickets
patch.txt