From cb661f2595f7d593377f11e574a857618bfb4d6a Mon Sep 17 00:00:00 2001 From: John Garland Date: Sun, 16 Sep 2012 17:09:23 +1000 Subject: [PATCH 1/4] Update google.ico so tracker_icons tests pass again --- tests/google.ico | Bin 1150 -> 5430 bytes 1 file changed, 0 insertions(+), 0 deletions(-) diff --git a/tests/google.ico b/tests/google.ico index ee7c943abf1064e3110161deb3a6477fcc7789b5..f594697d2f9edeb4e5b921d406a0b4b60512bfae 100644 GIT binary patch literal 5430 zcmc&&=}#3`6d#*@^NZ)MUY=zx&5q8s`(D$uOmJ5Bh+pfZW`2?cs>vue*g>c$$ zK(EWJ!+qTe^Zbr?vTyxjo~wf0d~OImb?xS*-{CyE1-10k1h1$pk~Y~*rxUbPx#V~K z$Qts&QJ5EYz`VK_p86W@tEUi^UqzBn=qf3Mr}e}6uNh+NoUCNE-AiGftpwn~IJq$^ zS@TQ6wv&HCdVT=DDb3-GaPFs(fotv0L^s1h?B+`jK!FYJ(*@N%{Vcl=weL9 zW?Q20j|LB8_vaCRFeXJ?Rx0@zb79}jonZBfgj)v zzNDDv4;hEDpYZ(_4St6l_Hx)1Ey5>utTmCkP*Q=P|6 z@I)`Pns3wcq>~$t#m2u0mmXgv}EKR4mbFXV=NEOby2^q+tnszwA#fZ zw!v<_B6V@?5ZILI?)7y`8RJxGWSKCX`mwcA7hDHo+x(3BjE2oVKV7rU&tW!Lw@yl( zZs&txYYn5mn7+O3Qlj5l%;A0^Tz<7$-K288+9_!SK{qh~vCv z^NmE+f&d=Y^+RK_ZhhYh*muvs?fD1p^LAOou@T&pgvI4-)-)V1*Zje7|9=Gi;7<_c zUqajUoy?287ev|YQSk%!9>L)JJEU)*oCr8RESjF8O9^_%Wf2 zCdaiOkFfRY`&Y}~`NFken4X;JCDZ+$jrzqQ{r2XW;Pc4C(+4O|7sZcH@n8J>sBGCcR2TQ%^|iggi7}2yw;Fh6X?_SE|>Yw?dgy;uUvS_McSCYuT8Zp m-~C6v`!DW8^VNR_J@Ch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 From: John Garland Date: Sun, 16 Sep 2012 17:12:16 +1000 Subject: [PATCH 2/4] Don't use deprecated twisted imports (fixes #2164) Aliases have been removed in twisted 12.2.0. --- deluge/ui/tracker_icons.py | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/deluge/ui/tracker_icons.py b/deluge/ui/tracker_icons.py index 91a02e46e..a9d55283a 100644 --- a/deluge/ui/tracker_icons.py +++ b/deluge/ui/tracker_icons.py @@ -39,7 +39,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 @@ -235,7 +240,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) @@ -375,14 +380,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 17cac01673d479ecb4f4dbbc16a5c82bc19907e9 Mon Sep 17 00:00:00 2001 From: John Garland Date: Sun, 16 Sep 2012 18:36:58 +1000 Subject: [PATCH 3/4] 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 08bcfd4cc..dea68fdfe 100644 --- a/deluge/ui/gtkui/gtkui.py +++ b/deluge/ui/gtkui/gtkui.py @@ -373,7 +373,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 68990b4a3f4d033b622fd4e27942f829bfcd03b1 Mon Sep 17 00:00:00 2001 From: John Garland Date: Sun, 16 Sep 2012 18:40:53 +1000 Subject: [PATCH 4/4] Fix execute plugin not working with unicode torrent names --- deluge/plugins/execute/execute/core.py | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/deluge/plugins/execute/execute/core.py b/deluge/plugins/execute/execute/core.py index a1df19ea5..9d95f74f9 100644 --- a/deluge/plugins/execute/execute/core.py +++ b/deluge/plugins/execute/execute/core.py @@ -108,6 +108,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):