Opened 5 years ago
Closed 4 years ago
#3385 closed bug (Fixed)
TypeError: a bytes-like object is required, not 'str'
Reported by: | Jo | Owned by: | |
---|---|---|---|
Priority: | minor | Milestone: | 2.0.4 |
Component: | Unknown | Version: | 2.0.3 |
Keywords: | Cc: |
Description
Python 3.7 libtorrent 1.2.5 boost 1.72 FreeBSD 11.3-RELEASE-p7 (FreeNAS.amd64)
Traceback (most recent call last): File "/home/deluge/.local/bin/deluged", line 11, in <module> load_entry_point('deluge==2.0.4.dev0', 'console_scripts', 'deluged')() File "/home/deluge/.local/lib/python3.7/site-packages/deluge-2.0.4.dev0-py3.7.egg/deluge/core/daemon_entry.py", line 87, in start_daemon options = parser.parse_args() File "/home/deluge/.local/lib/python3.7/site-packages/deluge-2.0.4.dev0-py3.7.egg/deluge/argparserbase.py", line 250, in parse_args return self._handle_ui_options(options) File "/home/deluge/.local/lib/python3.7/site-packages/deluge-2.0.4.dev0-py3.7.egg/deluge/argparserbase.py", line 329, in _handle_ui_options _file.write('%d\n' % os.getpid()) TypeError: a bytes-like object is required, not 'str'
changing the line to
_file.write(b'%d\n' % os.getpid())
allows it to get further, but then I get an OpenSSL error which I'll make another ticket for.
Change History (2)
comment:1 by , 4 years ago
comment:2 by , 4 years ago
Milestone: | needs verified → 2.0.4 |
---|---|
Resolution: | → Fixed |
Status: | new → closed |
This was fixed in [1b4ac88ce7]
Note:
See TracTickets
for help on using tickets.
SITUATION :
OS : Ubuntu 20.04.1 (xubuntu-desktop) PPA : "ppa:deluge-team/stable"
To start deluge as a daemon, I created a systemd service file "/etc/systemd/system/deluged.service" containing
This gives the fatal failure "TypeError: a bytes-like object is required, not 'str'" on starting the service.
WORKAROUND :
Remove the "--pidfile=/tmp/deluged.pid" from ExecStart.
CAUSE:
The file "/usr/lib/python3/dist-packages/deluge/argparserbase.py" contains
Line 328 enforces BINARY WRITES to the PID-file. But a string will be written in line 329. This causes a write-error (and ultimately the fatal failure).
SOLUTION :
Change line 328 in
The 'wb' is changed in 'w'. :)