You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The aquireLock method is failing to write it's PID to a new lockfile:
Traceback (most recent call last):
File "build/bdist.linux-x86_64/egg/serial/serialutil.py", line 261, in __init_
_
File "build/bdist.linux-x86_64/egg/serial/serialposix.py", line 366, in open
File "build/bdist.linux-x86_64/egg/serial/serialposix.py", line 301, in acquir
eLock
TypeError: str() takes at most 1 argument (2 given)
The offending line is pid = bytes(str(os.getpid()) + "\n", encoding='UTF-8'). bytes is defined for python 2 in the serialutil file as bytes = str. The str function in python 2 does not support the encoding argument. I fixed this with an extra error check:
I am certain this is the wrong solution. I believe that bytes in python2 should be emulated by the bytearray built-in. At least, that is the evolutionary path from the python3 documentation. Except, bytearray is redefined by a class in the serialutil file. I am unsure why a custom class was required to replace the bytearray built-in, so I defer to someone more experience with the library.
The text was updated successfully, but these errors were encountered:
The aquireLock method is failing to write it's PID to a new lockfile:
The offending line is
pid = bytes(str(os.getpid()) + "\n", encoding='UTF-8')
.bytes
is defined for python 2 in the serialutil file asbytes = str
. The str function in python 2 does not support the encoding argument. I fixed this with an extra error check:I am certain this is the wrong solution. I believe that bytes in python2 should be emulated by the bytearray built-in. At least, that is the evolutionary path from the python3 documentation. Except, bytearray is redefined by a class in the serialutil file. I am unsure why a custom class was required to replace the bytearray built-in, so I defer to someone more experience with the library.
The text was updated successfully, but these errors were encountered: