GTK-UI stops working after adding torrent

General support for problems installing or using Deluge
Post Reply
bro
Top Bloke
Top Bloke
Posts: 364
Joined: Sun Aug 28, 2011 6:46 pm
Location: Norway

GTK-UI stops working after adding torrent

Post 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
When reporting issues, please include any relevant information such as OS (and version), python version (for Windows users this depends on which Deluge installer was used), Deluge version and plugin version.
Cas
Top Bloke
Top Bloke
Posts: 3679
Joined: Mon Dec 07, 2009 6:04 am
Location: Scotland

Re: GTK-UI stops working after adding torrent

Post 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.
bro
Top Bloke
Top Bloke
Posts: 364
Joined: Sun Aug 28, 2011 6:46 pm
Location: Norway

Re: GTK-UI stops working after adding torrent

Post 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: ™
When reporting issues, please include any relevant information such as OS (and version), python version (for Windows users this depends on which Deluge installer was used), Deluge version and plugin version.
johnnyg
Top Bloke
Top Bloke
Posts: 1522
Joined: Sun Oct 28, 2007 4:00 am
Location: Sydney, Australia

Re: GTK-UI stops working after adding torrent

Post by johnnyg »

What version of libtorrent are you using?
bro
Top Bloke
Top Bloke
Posts: 364
Joined: Sun Aug 28, 2011 6:46 pm
Location: Norway

Re: GTK-UI stops working after adding torrent

Post by bro »

johnnyg wrote:What version of libtorrent are you using?
That would be 0.15.7.0
When reporting issues, please include any relevant information such as OS (and version), python version (for Windows users this depends on which Deluge installer was used), Deluge version and plugin version.
bro
Top Bloke
Top Bloke
Posts: 364
Joined: Sun Aug 28, 2011 6:46 pm
Location: Norway

Re: GTK-UI stops working after adding torrent

Post 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.
When reporting issues, please include any relevant information such as OS (and version), python version (for Windows users this depends on which Deluge installer was used), Deluge version and plugin version.
Cas
Top Bloke
Top Bloke
Posts: 3679
Joined: Mon Dec 07, 2009 6:04 am
Location: Scotland

Re: GTK-UI stops working after adding torrent

Post 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") 

bro
Top Bloke
Top Bloke
Posts: 364
Joined: Sun Aug 28, 2011 6:46 pm
Location: Norway

Re: GTK-UI stops working after adding torrent

Post 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
Last edited by Cas on Sat Nov 26, 2011 3:18 pm, edited 1 time in total.
Reason: add bug ticket
When reporting issues, please include any relevant information such as OS (and version), python version (for Windows users this depends on which Deluge installer was used), Deluge version and plugin version.
Post Reply