diff --git a/deluge/core/torrent.py b/deluge/core/torrent.py index faf59a4..b8a6bf7 100644 --- a/deluge/core/torrent.py +++ b/deluge/core/torrent.py @@ -834,25 +834,18 @@ def connect_peer(self, ip, port): def move_storage(self, dest): """Move a torrent's storage location""" - # 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): + if not os.path.exists(dest): try: # Try to make the destination path if it doesn't exist - os.makedirs(dest_u) + os.makedirs(dest) except IOError, e: log.exception(e) - log.error("Could not move storage for torrent %s since %s does not exist and could not create the directory.", self.torrent_id, dest_u) + log.error("Could not move storage for torrent %s since %s does not exist and could not create the directory.", self.torrent_id, dest) return False try: - self.handle.move_storage(dest_u) - except: + self.handle.move_storage(dest.encode("utf-8")) + except Exception, e: + log.exception(e) return False return True