Open skilfoy opened 2 years ago
you may just need to edit the script :D, specifically change the default
variable at the line 48.
parser.add_argument("--port", type=int, help="printer port",default=30886 )
File "./lpd/lpdtest.py", line 185 - TypeError
.
bytes("\002"+queue+"\n"
,'utf-8')
- "takes at most 1 argument (2 given)"$ python2
Python 2.7.18 (default, Jul 1 2022, 12:27:04)
[GCC 9.4.0] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>>
>>> bytes("")
''
>>> bytes("\002")
'\x02'
>>>
>>> bytes("\002"+"\n")
'\x02\n'
>>> bytes("\002"+"\n",'utf-8')
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
TypeError: str() takes at most 1 argument (2 given)
>>>
Whether I change the default port in the script from 515 to (for example) 30886 or if I specify the port in the bash command with the option --port 30886, I get the same error:
If I don't specify the port, the script seems to fire off, although the print server is not on port 515, so nothing happens. But at least I don't get an error. The error only occurs when I specify the port.
Why does changing the port number make the script think that there's an additional argument? And how can this be fixed?