{{{
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.
--
Ticket URL: <https://dev.deluge-torrent.org/ticket/3385>
Deluge <https://deluge-torrent.org/>
Deluge Project
Comment (by lyckeleb):
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
ExecStart=/usr/bin/deluged --port=56789 --do-not-daemonize
--pidfile=/tmp/deluged.pid
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
{{{
326 # Write pid file before chuid
327 if options.pidfile:
328 with open(options.pidfile, 'wb') as _file:
329 _file.write('%d\n' % os.getpid())
}}}
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
{{{
328 with open(options.pidfile, 'w') as _file:
}}}
The 'wb' is changed in 'w'. :)
--
Ticket URL: <https://dev.deluge-torrent.org/ticket/3385#comment:1>
* status: new => closed
* resolution: => Fixed
* milestone: needs verified => 2.0.4
Comment:
This was fixed in [1b4ac88ce7]
--
Ticket URL: <https://dev.deluge-torrent.org/ticket/3385#comment:2>