Module: deluge Branch: 1.3-stable Commit: 7d36a4fa51accdc90c3a3885cba6704f343bbfe5
Author: Calum Lind <[email protected]> Date: Fri Feb 11 09:48:00 2011 +0000 Fix #1527 - Converting unicode to unicode error in move_storage --- deluge/core/torrent.py | 13 +++++++++---- 1 files changed, 9 insertions(+), 4 deletions(-) diff --git a/deluge/core/torrent.py b/deluge/core/torrent.py index 38ff6d6..4c5ce5f 100644 --- a/deluge/core/torrent.py +++ b/deluge/core/torrent.py @@ -793,10 +793,15 @@ class Torrent(object): def move_storage(self, dest): """Move a torrent's storage location""" - - # Convert path from utf8 to unicode - dest_u=unicode(dest,"utf-8") - + + # Attempt to convert utf8 path to unicode + # Note: Inconsistent encoding for 'dest', needs future investigation + try: + dest_u = unicode(dest, "utf-8") + except TypeError: + # String is already unicode + dest_u = dest + if not os.path.exists(dest_u): try: # Try to make the destination path if it doesn't exist -- You received this message because you are subscribed to the Google Groups "deluge-commit" 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-commit?hl=en.
