aresch / rencode

Python module for fast (basic) object serialization similar to bencode
GNU General Public License v3.0
29 stars 7 forks source link

Deluge crashes if python-rencode is installed #15

Open arvidjaar opened 7 years ago

arvidjaar commented 7 years ago

I found that on Ubuntu 16.04 Deluge would crash trying to access non-UNICODE file names if python-rencode package is installed. More details are in this bug report: https://bugs.launchpad.net/bugs/1705066 (a bit long so not duplicated here).

The version in Ubuntu 16.04: python-rencode 1.0.3.

Please let me know what additional information is required. Thank you.

aresch commented 7 years ago

Have you tried uninstalling python-rencode and re-running the command? It looks like the error is actually occurring within Deluge and not rencode. It looks like it's failing on decode, which is a bit strange because the string should already be a unicode object since rencode.loads() is being called with utf8_decode=True.

arvidjaar commented 7 years ago

@aresch

Have you tried uninstalling python-rencode and re-running the command?

Yes, of course. That is how I found that this package mysteriously breaks deluge.

It looks like the error is actually occurring within Deluge and not rencode.

I opened bug against deluge and was advised to report problem here. Specifically as comment on this bug report puts it "We ship a python-only version of rencode with Deluge" so it appears installed version takes precedence. I am open to try whatever steps you recommend to better diagnose it, but I am neither deluge nor recode nor python in general expert so I need guidance.

The fact currently is - just be installing this package deluge stops working. I am not interested in finger pointing, all that I want is fixing this problem, be it in deluge or in recode; and to do it I need your (both) assistance.

aresch commented 7 years ago

Would it be possible to show me the output when you don't have python-rencode installed? All I would need is the torrent status directly after where it crashes with python-rencode. I'd like to see what strings it's trying to decode.

arvidjaar commented 7 years ago

Sure.

bor@bor-Latitude-E5450:~$ deluge-console info 521ef3ac4e7e62db15f73e8c0e3db68c7ff5a216

Name: openSUSE-Leap-42.2-DVD-x86_64.iso
ID: 521ef3ac4e7e62db15f73e8c0e3db68c7ff5a216
State: Error
Size: 0.0 КБ/4.1 ГБ Ratio: -1.000
Seed time: 0 days 00:00:00 Active: 0 days 00:00:11
Tracker status: opensuse.org: Анонс успешно выполнен
Progress: 0.00% [~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~]
bor@bor-Latitude-E5450:~$ deluge-console info 521ef3ac4e7e62db15f73e8c0e3db68c7ff5a216
'ascii' codec can't decode byte 0xd0 in position 0: ordinal not in range(128)
[ERROR   ] 06:11:18 main:347 'ascii' codec can't decode byte 0xd0 in position 0: ordinal not in range(128)
Traceback (most recent call last):
  File "/usr/lib/python2.7/dist-packages/deluge/ui/console/main.py", line 344, in do_command
    ret = self._commands[cmd].handle(*args, **options.__dict__)
  File "/usr/lib/python2.7/dist-packages/deluge/ui/console/commands/info.py", line 131, in handle
    torrent_ids.extend(self.console.match_torrent(arg))
  File "/usr/lib/python2.7/dist-packages/deluge/ui/console/main.py", line 462, in match_torrent
    if tid.startswith(string) or name.startswith(string):
UnicodeDecodeError: 'ascii' codec can't decode byte 0xd0 in position 0: ordinal not in range(128)
Traceback (most recent call last):
  File "/usr/lib/python2.7/dist-packages/deluge/ui/console/main.py", line 344, in do_command
    ret = self._commands[cmd].handle(*args, **options.__dict__)
  File "/usr/lib/python2.7/dist-packages/deluge/ui/console/commands/info.py", line 131, in handle
    torrent_ids.extend(self.console.match_torrent(arg))
  File "/usr/lib/python2.7/dist-packages/deluge/ui/console/main.py", line 462, in match_torrent
    if tid.startswith(string) or name.startswith(string):
UnicodeDecodeError: 'ascii' codec can't decode byte 0xd0 in position 0: ordinal not in range(128)

bor@bor-Latitude-E5450:~$ 
aresch commented 7 years ago

Could you run: deluge-console -L DEBUG info 521ef3ac4e7e62db15f73e8c0e3db68c7ff5a216 for both python-rencode and without?

arvidjaar commented 7 years ago

Sure

bor@bor-Latitude-E5450:~$ deluge-console -L DEBUG info 521ef3ac4e7e62db15f73e8c0e3db68c7ff5a216
[INFO    ] 21:09:41 ui:121 Deluge ui 1.3.12
[DEBUG   ] 21:09:41 ui:122 options: {'loglevel': 'debug', 'logfile': None, 'config': None, 'quiet': False}
[DEBUG   ] 21:09:41 ui:123 args: ['info', '521ef3ac4e7e62db15f73e8c0e3db68c7ff5a216']
[INFO    ] 21:09:41 ui:124 Starting console ui..
[DEBUG   ] 21:09:41 main:155 Using encoding: UTF-8
[INFO    ] 21:09:41 client:217 Connecting to daemon at 127.0.0.1:58846..
[DEBUG   ] 21:09:41 coreconfig:43 CoreConfig init..
[INFO    ] 21:09:41 client:121 Connected to daemon at 127.0.0.1:58846..

Name: openSUSE-Leap-42.2-DVD-x86_64.iso
ID: 521ef3ac4e7e62db15f73e8c0e3db68c7ff5a216
State: Error
Size: 0.0 КБ/4.1 ГБ Ratio: -1.000
Seed time: 0 days 00:00:00 Active: 0 days 00:00:03
Tracker status: opensuse.org: Анонс успешно выполнен
Progress: 0.00% [~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~]
[INFO    ] 21:09:41 client:224 Connection lost to daemon at 127.0.0.1:58846 reason: Connection was closed cleanly.
bor@bor-Latitude-E5450:~$ deluge-console -L DEBUG info 521ef3ac4e7e62db15f73e8c0e3db68c7ff5a216
[INFO    ] 21:10:19 ui:121 Deluge ui 1.3.12
[DEBUG   ] 21:10:19 ui:122 options: {'loglevel': 'debug', 'logfile': None, 'config': None, 'quiet': False}
[DEBUG   ] 21:10:19 ui:123 args: ['info', '521ef3ac4e7e62db15f73e8c0e3db68c7ff5a216']
[INFO    ] 21:10:19 ui:124 Starting console ui..
[DEBUG   ] 21:10:19 main:155 Using encoding: UTF-8
[INFO    ] 21:10:19 client:217 Connecting to daemon at 127.0.0.1:58846..
[DEBUG   ] 21:10:19 coreconfig:43 CoreConfig init..
[INFO    ] 21:10:19 client:121 Connected to daemon at 127.0.0.1:58846..
'ascii' codec can't decode byte 0xd0 in position 0: ordinal not in range(128)
[ERROR   ] 21:10:19 main:347 'ascii' codec can't decode byte 0xd0 in position 0: ordinal not in range(128)
Traceback (most recent call last):
  File "/usr/lib/python2.7/dist-packages/deluge/ui/console/main.py", line 344, in do_command
    ret = self._commands[cmd].handle(*args, **options.__dict__)
  File "/usr/lib/python2.7/dist-packages/deluge/ui/console/commands/info.py", line 131, in handle
    torrent_ids.extend(self.console.match_torrent(arg))
  File "/usr/lib/python2.7/dist-packages/deluge/ui/console/main.py", line 462, in match_torrent
    if tid.startswith(string) or name.startswith(string):
UnicodeDecodeError: 'ascii' codec can't decode byte 0xd0 in position 0: ordinal not in range(128)
Traceback (most recent call last):
  File "/usr/lib/python2.7/dist-packages/deluge/ui/console/main.py", line 344, in do_command
    ret = self._commands[cmd].handle(*args, **options.__dict__)
  File "/usr/lib/python2.7/dist-packages/deluge/ui/console/commands/info.py", line 131, in handle
    torrent_ids.extend(self.console.match_torrent(arg))
  File "/usr/lib/python2.7/dist-packages/deluge/ui/console/main.py", line 462, in match_torrent
    if tid.startswith(string) or name.startswith(string):
UnicodeDecodeError: 'ascii' codec can't decode byte 0xd0 in position 0: ordinal not in range(128)

[INFO    ] 21:10:19 client:224 Connection lost to daemon at 127.0.0.1:58846 reason: Connection was closed cleanly.
bor@bor-Latitude-E5450:~$