freebsd-ports/net-p2p/deluge/files/patch-deluge_httpdownloader.py
Ruslan Makhmatkhanov f05c0d9ec0 net-p2p/deluge: support staging and more
- do not use easy_install and convert to auto-generated plist
- add staging support
- convert USE_XZ to USES
- Makefile clean-up

- add startup script for deluge-web [1]

PR:     185888
Reported by:    huber.georg@gmail.com
Submitted by:   Daniel O'Connor <darius@dons.net.au> (private email) [1]

- fix compatibility issue with twisted > 13.1.0, that prevents BlockList plugin
  from work correctly [2]

PR:     189497
Submitted by:   George Amanakis <g_amanakis@yahoo.com> [2]
2014-06-05 09:20:25 +00:00

21 lines
835 B
Python

--- ./deluge/httpdownloader.py.orig 2013-02-25 21:01:07.000000000 +0400
+++ ./deluge/httpdownloader.py 2014-06-05 12:56:06.000000000 +0400
@@ -192,7 +192,17 @@
headers = {}
headers["accept-encoding"] = "deflate, gzip, x-gzip"
- scheme, host, port, path = client._parse(url)
+ # In twisted 13.1.0 the _parse() function was replaced by the _URI class
+ if hasattr(client, '_parse'):
+ scheme, host, port, path = client._parse(url)
+ else:
+ from twisted.web.client import _URI
+ uri = _URI.fromBytes(url)
+ scheme = uri.scheme
+ host = uri.host
+ port = uri.port
+ path = uri.path
+
factory = HTTPDownloader(url, filename, callback, headers, force_filename, allow_compression)
if scheme == "https":
from twisted.internet import ssl