Something i'm guessing is related, is that when starting deluged.exe
manually, then it does work to connect to, but the daemon doesn't
background itself no more, as it did in previous deluge 1.3.15, and no
options to make it fork itself to background is available. The same with
the webUI, so i'm guessing it is related with above issue, or otherwise
there is two issues to report here.
The fix for pidfile creation(#3278), when applied, didn't fix either of
these issues.
Thanks in advance.
--
Ticket URL: <https://dev.deluge-torrent.org/ticket/3313>
Deluge <https://deluge-torrent.org/>
Deluge Project
Comment (by mhertz):
Sorry, forgot adding debug-logs previously. There where no errors shown
when running debug-log of deluged.exe, but has issue as stated before of
not going to background and staying in foreground, so if doubleclicking
it, then it leaves the new terminal open, instead of just briefly
"blinking" it.
Here follows snippet of erronymous part of debug-log of GTKUI in
thinclient mode while selecting 'Start daemon' from connection-manager,
which fails with error message in GUI as described in previous post:
{{{
15:16:26 [DEBUG ][deluge.ui.client :286 ]
sslproxy.connect()
15:16:26 [DEBUG ][deluge.ui.client :212 ] Connecting to
daemon at "127.0.0.1:58846"...
15:16:26 [DEBUG ][deluge.ui.gtk3.connectionmanager :241 ] Host Status:
127.0.0.1,
15:16:27 [DEBUG ][deluge.ui.client :219 ] Connection to
daemon at "127.0.0.1:58846" failed: Connection was refused by other side:
10061: Der kunne ikke oprettes forbindelse, fordi destinationscomputeren
aktivt nægtede det..
15:16:27 [DEBUG ][deluge.ui.client :596 ]
on_connect_fail: [Failure instance: Traceback (failure with no frames):
<class 'twisted.internet.error.ConnectionRefusedError'>: Connection was
refused by other side: 10061: Der kunne ikke oprettes forbindelse, fordi
destinationscomputeren aktivt nægtede det..
]
15:16:27 [DEBUG ][deluge.ui.client :302 ]
sslproxy.disconnect()
15:16:27 [DEBUG ][deluge.ui.hostlist :203 ] Host status
failed for 214f05ec5cdf46d794d3a17801d49e77: [Failure instance: Traceback
(failure with no frames): <class
'twisted.internet.error.ConnectionRefusedError'>: Connection was refused
by other side: 10061: Der kunne ikke oprettes forbindelse, fordi
destinationscomputeren aktivt nægtede det..
]
15:16:27 [DEBUG ][deluge.ui.gtk3.connectionmanager :241 ] Host Status:
127.0.0.1, offline
15:16:30 [DEBUG ][deluge.ui.gtk3.connectionmanager :495 ]
on_button_startdaemon_clicked
15:16:30 [ERROR ][deluge.ui.client :688 ] Unable to
start daemon!
15:16:30 [ERROR ][deluge.ui.client :1343] a bytes-like
object is required, not 'str'
Traceback (most recent call last):
File "c:\program files\python36\lib\site-packages\deluge\ui\client.py",
line 674, in start_daemon
subprocess.Popen(['deluged', '--port=%s' % port, b'--config=%s' %
config])
File "c:\program files\python36\lib\subprocess.py", line 729, in
__init__
restore_signals, start_new_session)
File "c:\program files\python36\lib\subprocess.py", line 991, in
_execute_child
args = list2cmdline(args)
File "c:\program files\python36\lib\subprocess.py", line 481, in
list2cmdline
needquote = (" " in arg) or ("\t" in arg) or not arg
TypeError: a bytes-like object is required, not 'str'
}}}
--
Ticket URL: <https://dev.deluge-torrent.org/ticket/3313#comment:1>
Comment (by tobbez):
This can be fixed by applying the following change:
{{{
#!diff
diff --git a/deluge/ui/client.py b/deluge/ui/client.py
index 686f962b3..4db737c28 100644
--- a/deluge/ui/client.py
+++ b/deluge/ui/client.py
@@ -668,10 +668,8 @@ def start_daemon(self, port, config):
bool: True is successfully started the daemon, False
otherwise.
"""
- # subprocess.popen does not work with unicode args (with non-
ascii characters) on windows
- config = config.encode(sys.getfilesystemencoding())
try:
- subprocess.Popen(['deluged', '--port=%s' % port, b'--
config=%s' % config])
+ subprocess.Popen(['deluged', '--port=%s' % port, '--
config=%s' % config])
except OSError as ex:
from errno import ENOENT
}}}
On Python 3 this works even when the config directory path contains non-
ASCII characters, but on Python 2 it likely won't.
--
Ticket URL: <https://dev.deluge-torrent.org/ticket/3313#comment:2>
Comment (by mhertz):
Awesome, thank you so much tobbez, I really appreciate this alot! :)
I now only have one issue left still, and that is that the deluged daemon
still doesn't background itself, so when selecting 'Start daemon' from
connection-manager, then there opens a terminal-window which keeps staying
open, and the same if running deluged manually where it doesn't background
itself, like it did in deluge 1.3.15. No errors though.
Do you have any ideas aabout that?
In either case, I really appreciated your help with this so many thanks
again!
--
Ticket URL: <https://dev.deluge-torrent.org/ticket/3313#comment:3>
Comment (by mhertz):
@tobbez, do the code you posted for .5 work for you locally?
I used my deluge2 from Cas's install-instructions and because of admin-
rights needed, I copied deluged.exe into my win10 VM's user(fooba)
Downloads folder and changed your code to match my system and then runned
it and it did change the file I could see from the file-properties, and
then I overwrote deluged.exe from Downloads and back to correct place
again(I did backup it first), but the result is same as before and I can
see python and not pythonw.exe runs deluged.exe still and doesn't
background itself.
I apologize in advance if messing up your instructions, as that is very
likely ;)
--
Ticket URL: <https://dev.deluge-torrent.org/ticket/3313#comment:4>
* milestone: needs verified => 2.0.6
--
Ticket URL: <https://dev.deluge-torrent.org/ticket/3313#comment:5>
Comment (by Cas):
Remember will need to verify can still handle non-ascii paths: https://dev
.deluge-torrent.org/ticket/2093
--
Ticket URL: <https://dev.deluge-torrent.org/ticket/3313#comment:6>