Opened 11 years ago

Closed 10 years ago

#2355 closed bug (Fixed)

Twisted 13.1 incompatible?

Reported by: semi225599 Owned by:
Priority: major Milestone: 1.3.7
Component: Unknown Version: master
Keywords: Cc: cb47492@…

Description

Just upgraded to the latest Twisted (13.1) and downloading blocklists now hangs. I looked at the output, and there is a Traceback in some twisted files; I don't have the output anymore as I downgraded for functionality, but I remember at the end:

'module' object has no method _parse

To make matters worse, this causes everything else in Deluge to freeze, torrents appear paused, and I can't close the process without killing it.

Using Arch Linux 32-bit, Deluge 1.3.6, upgraded from Twisted 13.0 to 13.1

Attachments (1)

0001-Fix-twisted-13.1-compat.patch (1.0 KB) - added by monstermunchkin 11 years ago.

Download all attachments as: .zip

Change History (12)

comment:1 Changed 11 years ago by semi225599

Output:

Unhandled error in Deferred:
Unhandled Error
Traceback (most recent call last):
  File "/usr/lib/python2.7/site-packages/deluge/plugins/init.py", line 48, in enable
    self.plugin.enable()
  File "/usr/lib/python2.7/site-packages/deluge/plugins/Blocklist-1.2-py2.7.egg/blocklist/core.py", line 116, in enable
    
  File "/usr/lib/python2.7/site-packages/twisted/internet/task.py", line 173, in start
    self()
  File "/usr/lib/python2.7/site-packages/twisted/internet/task.py", line 218, in __call__
    d = defer.maybeDeferred(self.f, *self.a, **self.kw)
--- <exception caught here> ---
  File "/usr/lib/python2.7/site-packages/twisted/internet/defer.py", line 137, in maybeDeferred
    result = f(*args, **kw)
  File "/usr/lib/python2.7/site-packages/deluge/plugins/Blocklist-1.2-py2.7.egg/blocklist/core.py", line 151, in check_import
    
  File "/usr/lib/python2.7/site-packages/deluge/plugins/Blocklist-1.2-py2.7.egg/blocklist/core.py", line 260, in download_list
    
  File "/usr/lib/python2.7/site-packages/deluge/httpdownloader.py", line 195, in download_file
    scheme, host, port, path = client._parse(url)
exceptions.AttributeError: 'module' object has no attribute '_parse'

comment:2 Changed 11 years ago by Respen

I am having the exact same problem with Blocklist and twisted 13.1, apparently. I am getting almost exactly the same error message. My error message is exactly the same past the <exception caught here> line.

Downgrading to twisted 13.0 like the reporter suggested fixed the problem, as does disabling the Blocklist plugin. Only when actively telling (including setting the plugin to import on program start) the plugin to download and/or import a list (local or remote) does the problem occur.

Like the reporter, I am using Arch Linux i686, Deluge 1.3.6, and upgraded Twisted 13.0 to 13.1.

comment:3 Changed 11 years ago by cb474

I am also having this problem and downgrading to Twisted 13.0 also solved the problem for me.

The error I get is mostly, but not entirely the same:

Unhandled error in Deferred:
Unhandled Error
Traceback (most recent call last):
  File "/usr/lib/python2.7/site-packages/deluge/plugins/init.py", line 48, in enable
    self.plugin.enable()
  File "/usr/lib/python2.7/site-packages/deluge/plugins/Blocklist-1.2-py2.7.egg/blocklist/core.py", line 116, in enable
    
  File "/usr/lib/python2.7/site-packages/twisted/internet/task.py", line 173, in start
    self()
  File "/usr/lib/python2.7/site-packages/twisted/internet/task.py", line 218, in __call__
    d = defer.maybeDeferred(self.f, *self.a, **self.kw)
--- <exception caught here> ---
  File "/usr/lib/python2.7/site-packages/twisted/internet/defer.py", line 137, in maybeDeferred
    result = f(*args, **kw)
  File "/usr/lib/python2.7/site-packages/deluge/plugins/Blocklist-1.2-py2.7.egg/blocklist/core.py", line 151, in check_import
    
  File "/usr/lib/python2.7/site-packages/deluge/plugins/Blocklist-1.2-py2.7.egg/blocklist/core.py", line 260, in download_list
    
  File "/usr/lib/python2.7/site-packages/deluge/httpdownloader.py", line 195, in download_file
    scheme, host, port, path = client._parse(url)
exceptions.AttributeError: 'module' object has no attribute '_parse'

I started a thread on the problem here: http://forum.deluge-torrent.org/viewtopic.php?f=9&t=44885&p=187595.

And there's a bug report for Arch on it here: https://bugs.archlinux.org/task/36298

comment:4 Changed 11 years ago by cb474

  • Cc cb47492@… added

comment:5 in reply to: ↑ description ; follow-up: Changed 11 years ago by mintchkin

Sorry, this is my first time doing one of these, but if it helps at all, this bug appears to affect any action that requires downloading a file (including trying to download a torrent file) and can be fixed by changing the lines from:

deluge-1.3.6\deluge\httpdownloader.py

  41 : import os.path
  42 : import zlib
  ...
  195:     scheme, host, port, path = client._parse(url)
  196:     factory = HTTPDownloader(url, filename, callback, headers, force_filename, allow_compression)
  197:     if scheme == "https":

to something like:

deluge-1.3.6\deluge\httpdownloader.py

  41 : import os.path
  42 : import zlib
  xxx: import urlparse
  ...
  xxx:     parsed = urlparse(url)
  xxx:     scheme, host= parsed[:2]
  xxx:     port = parsed.port or (443 if scheme == 'https' else 80)
  xxx:     path = parsed.path or '/'
  196:     factory = HTTPDownloader(url, filename, callback, headers, force_filename, allow_compression)
  197:     if scheme == "https":

which should perform identically to the now defunct twisted.web.client._parse()

comment:6 in reply to: ↑ 5 Changed 11 years ago by mintchkin

...oops...the new import line should be:

  ...
  xxx: from urlparse import urlparse
  ...

...awkward...

comment:7 Changed 11 years ago by semi225599

Tried this code change and it now works.

comment:8 Changed 11 years ago by Cas

  • Milestone changed from Future to 1.3.7
  • Resolution set to fixed
  • Status changed from new to closed

The fix is already applied to our codebase: 06ee112344f7

comment:9 Changed 11 years ago by monstermunchkin

  • Resolution fixed deleted
  • Status changed from closed to reopened
  • Version changed from 1.3.6 to master (git branch)

The upstream fix does not work as the import is incorrect and 'uri.originFrom' doesn't exist. I attached a patch which fixes both issues.

Changed 11 years ago by monstermunchkin

comment:10 Changed 10 years ago by andar

I've applied the fix. Thanks.

comment:11 Changed 10 years ago by andar

  • Resolution set to Fixed
  • Status changed from reopened to closed
Note: See TracTickets for help on using tickets.