Opened 11 years ago

Closed 11 years ago

#2355 closed bug (Fixed)

Twisted 13.1 incompatible?

Reported by: Dan Owned by:
Priority: major Milestone: 1.3.7
Component: Unknown Version: master
Keywords: Cc: cb47492@gmail.com

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 Thomas Hipp 11 years ago.

Download all attachments as: .zip

Change History (12)

comment:1 by Dan, 11 years ago

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 by Respen, 11 years ago

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 by cb474, 11 years ago

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 by cb474, 11 years ago

Cc: cb47492@gmail.com added

in reply to:  description ; comment:5 by mintchkin, 11 years ago

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()

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

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

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

...awkward...

comment:7 by Dan, 11 years ago

Tried this code change and it now works.

comment:8 by Calum, 11 years ago

Milestone: Future1.3.7
Resolution: fixed
Status: newclosed

The fix is already applied to our codebase: 06ee112344f7

comment:9 by Thomas Hipp, 11 years ago

Resolution: fixed
Status: closedreopened
Version: 1.3.6master (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.

by Thomas Hipp, 11 years ago

comment:10 by andar, 11 years ago

I've applied the fix. Thanks.

comment:11 by andar, 11 years ago

Resolution: Fixed
Status: reopenedclosed
Note: See TracTickets for help on using tickets.