Page 1 of 1
GTK-UI stops working after adding torrent
Posted: Sun Nov 06, 2011 6:15 pm
by bro
Hi
I have a few hundred torrents running deluge daemon on FreeBSD, which works reasonably well. However, there is an issue with using the GTK-UI on another machine on the LAN.
Sometimes after adding a new torrent, some of the torrent lists stops loading
It seems the lists the newly added torrent is on will not load, except the "All" lists.
So the list for the tracker of the torrent won't load. The Queued list won't load, and the "No Label" list under Labels won't load.
The "All" list for State and the "All" list for Trackers load, but the new torrent does not show up in the lists.
After reconnecting it works as normal, and the torrent that was added is shown and works.
I didn't find an issue describing this in the issue tracker, so is this a new bug?
Server: Deluge 1.3.3, FreeBSD 8.2. Python 2.6.7
Client: Deluge 1.3.3, Ubuntu 11.04. Python 2.7.1, libgtk 2.24.4
Re: GTK-UI stops working after adding torrent
Posted: Sun Nov 06, 2011 6:28 pm
by Cas
If you can enable debug logs to see if there are any errors that would be helpful.
I know that with quite large numbers of torrents there can be client/server issues and git master has improvements in that area.
Re: GTK-UI stops working after adding torrent
Posted: Sun Nov 06, 2011 6:45 pm
by bro
I expected this to be a client issue, since a reconnect seems to work, but here is what I found in the deluge daemon log:
[ERROR ] 18:46:40 core:225 There was an error adding the torrent file NAME_OF_TORRENT_FILE.torrent
1067 [ERROR ] 18:46:40 core:226 'ascii' codec can't encode character u'\x99' in position 124: ordinal not in range(128)
1068 Traceback (most recent call last):
1069 File "/usr/local/lib/python2.6/site-packages/deluge-1.3.3-py2.6.egg/deluge/core/core.py", line 223, in add_torrent_file
1070 torrent_id = self.torrentmanager.add(filedump=filedump, options=options, filename=filename)
1071 File "/usr/local/lib/python2.6/site-packages/deluge-1.3.3-py2.6.egg/deluge/core/torrentmanager.py", line 495, in add
1072 "wb")
1073 UnicodeEncodeError: 'ascii' codec can't encode character u'\x99' in position 124: ordinal not in range(128)
The problem seems to be this bugger: ™
Re: GTK-UI stops working after adding torrent
Posted: Sun Nov 06, 2011 10:35 pm
by johnnyg
What version of libtorrent are you using?
Re: GTK-UI stops working after adding torrent
Posted: Sun Nov 06, 2011 11:08 pm
by bro
johnnyg wrote:What version of libtorrent are you using?
That would be 0.15.7.0
Re: GTK-UI stops working after adding torrent
Posted: Mon Nov 07, 2011 12:02 am
by bro
A workaround for this is to disable the option "Copy of .torrent files to".
This is the line:
Code: Select all
save_file = open(os.path.join(self.config["torrentfiles_location"], filename), "wb")
It seems
os.path.join or
open doesn't like the encoding of the filename, so I don't think this has anything to do with libtorrent.
Re: GTK-UI stops working after adding torrent
Posted: Mon Nov 07, 2011 12:08 am
by Cas
Yep thats correct the filename needs to be to converted to unicode.
Try using the utf8_encoded function to see if that fixes it:
Code: Select all
save_file = open(os.path.join(self.config["torrentfiles_location"], utf8_encoded(filename)), "wb")
Re: GTK-UI stops working after adding torrent
Posted: Mon Nov 07, 2011 12:50 am
by bro
That doesn't fix it.
Code: Select all
[ERROR ] 01:29:30 core:225 There was an error adding the torrent file TORRENT_FILE_NAME.torrent
[ERROR ] 01:29:30 core:226 'ascii' codec can't decode byte 0xc2 in position 73: ordinal not in range(128)
Traceback (most recent call last):
File "/usr/local/lib/python2.6/site-packages/deluge-1.3.3-py2.6.egg/deluge/core/core.py", line 223, in add_torrent_file
torrent_id = self.torrentmanager.add(filedump=filedump, options=options, filename=filename)
File "/usr/local/lib/python2.6/site-packages/deluge-1.3.3-py2.6.egg/deluge/core/torrentmanager.py", line 495, in add
save_file = open(os.path.join(self.config["torrentfiles_location"], utf8_encoded(filename)), "wb")
File "/usr/local/lib/python2.6/posixpath.py", line 70, in join
path += '/' + b
UnicodeDecodeError: 'ascii' codec can't decode byte 0xc2 in position 73: ordinal not in range(128)
The character isn't actually displayed correctly with UTF-8 in Firefox, so it won't work to encode as UTF8, but latin1 works:
Code: Select all
save_file = open(os.path.join(self.config["torrentfiles_location"], filename.encode("latin_1", "ignore")), "wb")
To make this work for all encodings, you'd have to try them all out or what?
Bug Ticket:
#1981