Merge branch '1.3-stable' of deluge-torrent.org:deluge into 1.3-stable
This commit is contained in:
commit
ec3d698a14
|
@ -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):
|
||||
|
|
|
@ -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()
|
||||
|
||||
|
||||
|
|
|
@ -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
|
||||
|
|
BIN
tests/google.ico
BIN
tests/google.ico
Binary file not shown.
Before Width: | Height: | Size: 1.1 KiB After Width: | Height: | Size: 5.3 KiB |
Loading…
Reference in New Issue