#1527: Unhandled Exception in "move_storage" (trying to convert an utf8 string
to
utf8)
---------------------+------------------------------------------------------
Reporter: idefixx | Owner:
Type: defect | Status: new
Priority: minor | Milestone: Future
Component: core | Version: other (please specify)
Keywords: |
---------------------+------------------------------------------------------
Deluge 1.3.1_dev (ea22bb0b10d52fa311c2a05f6a47d0893bd1bd78)
libtorrent 0.15.5 (r5250)
Debian Squeeze
This error occurs with or without AutoAdd on my deluged, when I want to
moved finished downloads on complete.
The attached patch fixes the problem on my machine.
{{{
03:12:23 [deluge.core.preferencesmanager][WARNING ] Unable to find GeoIP
database file!
03:14:27 [twisted ][ERROR ] Unhandled Error
Traceback (most recent call last):
File "/usr/local/lib/python2.6/dist-
packages/deluge-1.3.1-py2.6-linux-i686.egg/deluge/main.py", line 247, in
start_daemon
Daemon(options, args)
File "/usr/local/lib/python2.6/dist-
packages/deluge-1.3.1-py2.6-linux-i686.egg/deluge/core/daemon.py", line
173, in __init__
reactor.run()
File "/usr/lib/python2.6/dist-packages/twisted/internet/base.py", line
1165, in run
self.mainLoop()
File "/usr/lib/python2.6/dist-packages/twisted/internet/base.py", line
1174, in mainLoop
self.runUntilCurrent()
--- <exception caught here> ---
File "/usr/lib/python2.6/dist-packages/twisted/internet/base.py", line
796, in runUntilCurrent
call.func(*call.args, **call.kw)
File "/usr/local/lib/python2.6/dist-
packages/deluge-1.3.1-py2.6-linux-i686.egg/deluge/core/torrentmanager.py",
line 855, in on_alert_torrent_finished
torrent.move_storage(move_path)
File "/usr/local/lib/python2.6/dist-
packages/deluge-1.3.1-py2.6-linux-i686.egg/deluge/core/torrent.py", line
812, in move_storage
dest_u=unicode(dest,"utf-8")
exceptions.TypeError: decoding Unicode is not supported
}}}
{{{
diff --git a/deluge/core/torrent.py b/deluge/core/torrent.py
index a1a2bdd..77f9f5c 100644
--- a/deluge/core/torrent.py
+++ b/deluge/core/torrent.py
@@ -808,9 +808,13 @@ def connect_peer(self, ip, port):
def move_storage(self, dest):
"""Move a torrent's storage location"""
- # Convert path from utf8 to unicode
- dest_u=unicode(dest,"utf-8")
-
+ try:
+ # Convert path from utf8 to unicode
+ dest_u=unicode(dest,"utf-8")
+ except TypeError:
+ # String is already utf8
+ dest_u=dest
+
if not os.path.exists(dest_u):
try:
# Try to make the destination path if it doesn't exist
}}}
--
Ticket URL: <http://dev.deluge-torrent.org/ticket/1527>
Deluge <http://deluge-torrent.org/>
Deluge project
--
You received this message because you are subscribed to the Google Groups
"Deluge Dev" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to
[email protected].
For more options, visit this group at
http://groups.google.com/group/deluge-dev?hl=en.