From 5e1caf3746e2ec083faaeeaebe5794d63bb90b29 Mon Sep 17 00:00:00 2001 From: John Garland Date: Mon, 27 Aug 2012 08:25:38 +1000 Subject: [PATCH 1/5] Add compile arg needed by libtorrent 0.16.x --- setup.py | 1 + 1 file changed, 1 insertion(+) diff --git a/setup.py b/setup.py index cb21a809b..a55567c76 100755 --- a/setup.py +++ b/setup.py @@ -70,6 +70,7 @@ _extra_compile_args = [ "-DTORRENT_USE_OPENSSL=1", "-DBOOST_FILESYSTEM_VERSION=2", "-DBOOST_ASIO_ENABLE_CANCELIO", + "-DBOOST_ASIO_SEPARATE_COMPILATION", "-O2", ] From c8384bf304025b004a87a006fa84f8c0cf06dc78 Mon Sep 17 00:00:00 2001 From: John Garland Date: Sun, 16 Sep 2012 17:09:23 +1000 Subject: [PATCH 2/5] Update google.ico so tracker_icons tests pass again --- deluge/tests/google.ico | Bin 1150 -> 5430 bytes 1 file changed, 0 insertions(+), 0 deletions(-) diff --git a/deluge/tests/google.ico b/deluge/tests/google.ico index ee7c943abf1064e3110161deb3a6477fcc7789b5..f594697d2f9edeb4e5b921d406a0b4b60512bfae 100644 GIT binary patch literal 5430 zcmZQzU}Ruo5D);-3Je)63=C=v3=9ei5dI1Q28KQs1_liV1_l9;I0HnS0R&hW7=*YX z7{mqPFRe~qUs|1>e`$64Pa=K-)%%P@eaQA;*!#8D@Bgn8tN;Id|NQ^or`P}gzOwiK z@AF&#e_xn~tPdyq_l-mU|Gs(n|Lc@UgqjYw|9@^D|NngvVKe@|d;0(9?r8|U&~W*= zYs&xMmv>=^qx=2mzS;l(+&lCCONTpL?bk`+U^o3fzXdLat`C|2ePz}EUnf@m|G8({ z|DT5z{Qvjm-T%LDAOHV4DU2xnaI@Oo{{Q>-@&BJkm;Zn54i^%@_CxqM>_l-x zo6CPtdI6=QKMybb|Nrmr|6ixq|Np+c9Ge-G4ag3VT_8I_c58fT zb$U++d(p!jWGBdOkXz8@=*0)w{c!;N4)fnpE^&MjM-``+6zjU}^H6K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UxoOzi&|s*uTI3|NnpT*8czU>HG}!T`809c(wP1qiDLSH zt}pyQC>%g>7!Z8-KMTW`{|t=(|1&fE{m;Po`9A~0)Bns&w?NYWfB*jde_M{q{}ag! z|Ieo}{684U@c+{KW>C@xr#&~f2mcuve*R}*{_~%a@#lYLh7bQ47+?QqV7UMP|L;Fw zf9_}w_`frp;s2RrrvH1A`2K%-b_X06SFe2g&&BinKLf+x|ICd4{xdLw?Em(kh2hPA z2Brt#Jox|5@Bfc(pZUKmUg7^jAC~_Y*R=ir^Z)Pv_aA@$x3WJB_9qk5FR&R*VE2Ff S&%p2wtha#?l#9v3AiV%6LWsHm From 129c09c5a775ff7f673c611b6db14e3b499f26e9 Mon Sep 17 00:00:00 2001 From: John Garland Date: Sun, 16 Sep 2012 17:12:16 +1000 Subject: [PATCH 3/5] Don't use deprecated twisted imports (fixes #2164) Aliases have been removed in twisted 12.2.0. --- deluge/tests/test_httpdownloader.py | 6 +++++- deluge/ui/tracker_icons.py | 13 +++++++++---- 2 files changed, 14 insertions(+), 5 deletions(-) diff --git a/deluge/tests/test_httpdownloader.py b/deluge/tests/test_httpdownloader.py index 6e9c677a0..a4a53fc13 100644 --- a/deluge/tests/test_httpdownloader.py +++ b/deluge/tests/test_httpdownloader.py @@ -5,7 +5,11 @@ from twisted.trial import unittest from twisted.internet import reactor from twisted.python.failure import Failure from twisted.web.http import FORBIDDEN, NOT_MODIFIED -from twisted.web.resource import Resource, ForbiddenResource +try: + from twisted.web.resource import Resource, ForbiddenResource +except ImportError: + # twisted 8 + from twisted.web.error import Resource, ForbiddenResource from twisted.web.server import Site from deluge.httpdownloader import download_file diff --git a/deluge/ui/tracker_icons.py b/deluge/ui/tracker_icons.py index 008783696..c475381f5 100644 --- a/deluge/ui/tracker_icons.py +++ b/deluge/ui/tracker_icons.py @@ -40,7 +40,12 @@ from urlparse import urljoin, urlparse from tempfile import mkstemp from twisted.internet import defer, threads -from twisted.web import error +from twisted.web.error import PageRedirect +try: + from twisted.web.resource import NoResource, ForbiddenResource +except ImportError: + # twisted 8 + from twisted.web.error import NoResource, ForbiddenResource from deluge.component import Component from deluge.configmanager import get_config_dir @@ -238,7 +243,7 @@ class TrackerIcons(Component): error_msg = f.getErrorMessage() log.debug("Error downloading page: %s", error_msg) d = f - if f.check(error.PageRedirect): + if f.check(PageRedirect): # Handle redirect errors location = urljoin(self.host_to_url(host), error_msg.split(" to ")[1]) self.redirects[host] = url_to_host(location) @@ -378,14 +383,14 @@ class TrackerIcons(Component): error_msg = f.getErrorMessage() log.debug("Error downloading icon: %s", error_msg) d = f - if f.check(error.PageRedirect): + if f.check(PageRedirect): # Handle redirect errors location = urljoin(self.host_to_url(host), error_msg.split(" to ")[1]) d = self.download_icon([(location, extension_to_mimetype(location.rpartition('.')[2]))] + icons, host) if not icons: d.addCallbacks(self.on_download_icon_complete, self.on_download_icon_fail, callbackArgs=(host,), errbackArgs=(host,)) - elif f.check(error.NoResource, error.ForbiddenResource) and icons: + elif f.check(NoResource, ForbiddenResource) and icons: d = self.download_icon(icons, host) elif f.check(NoIconsError, HTMLParseError): # No icons, try favicon.ico as an act of desperation From 183c47f8102c26db8fe8eb6e71d06176ac86e854 Mon Sep 17 00:00:00 2001 From: John Garland Date: Sun, 16 Sep 2012 18:36:58 +1000 Subject: [PATCH 4/5] Fix deluge-gtk not working with twisted 12 (fixes #2148) --- deluge/ui/gtkui/gtkui.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/deluge/ui/gtkui/gtkui.py b/deluge/ui/gtkui/gtkui.py index 5726eea50..53072e2ac 100644 --- a/deluge/ui/gtkui/gtkui.py +++ b/deluge/ui/gtkui/gtkui.py @@ -405,7 +405,11 @@ Please see the details below for more information."), details=traceback.format_e if self.config["show_connection_manager_on_start"]: # XXX: We need to call a simulate() here, but this could be a bug in twisted - reactor.simulate() + try: + reactor._simulate() + except AttributeError: + # twisted < 12 + reactor.simulate() self.connectionmanager.show() From 9829bec3906e381f33ec3f6b3a1973568c8486b3 Mon Sep 17 00:00:00 2001 From: John Garland Date: Sun, 16 Sep 2012 18:40:53 +1000 Subject: [PATCH 5/5] Fix execute plugin not working with unicode torrent names --- deluge/plugins/Execute/deluge/plugins/execute/core.py | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/deluge/plugins/Execute/deluge/plugins/execute/core.py b/deluge/plugins/Execute/deluge/plugins/execute/core.py index ebd6447c5..928d7b248 100644 --- a/deluge/plugins/Execute/deluge/plugins/execute/core.py +++ b/deluge/plugins/Execute/deluge/plugins/execute/core.py @@ -110,6 +110,14 @@ class Core(CorePluginBase): else: save_path = info["save_path"] + # getProcessOutputAndValue requires args to be str + if isinstance(torrent_name, unicode): + torrent_id = torrent_id.encode("utf-8", "ignore") + if isinstance(torrent_name, unicode): + torrent_name = torrent_name.encode("utf-8", "ignore") + if isinstance(save_path, unicode): + save_path = save_path.encode("utf-8", "ignore") + log.debug("[execute] Running commands for %s", event) def log_error(result, command):