Fix renaming folders on libtorrent 0.16 compiled with unicode support (Windows)

This commit is contained in:
Chase Sterling 2013-02-11 21:36:46 -05:00
parent 92eb9feae4
commit c58221c866
1 changed files with 5 additions and 1 deletions

View File

@ -960,7 +960,11 @@ class Torrent(object):
if f["path"].startswith(folder): if f["path"].startswith(folder):
# Keep a list of filerenames we're waiting on # Keep a list of filerenames we're waiting on
wait_on_folder[2].append(f["index"]) wait_on_folder[2].append(f["index"])
self.handle.rename_file(f["index"], f["path"].replace(folder, new_folder, 1).encode("utf-8")) new_path = f["path"].replace(folder, new_folder, 1)
try:
self.handle.rename_file(f["index"], new_path)
except TypeError:
self.handle.rename_file(f["index"], new_path.encode("utf-8"))
self.waiting_on_folder_rename.append(wait_on_folder) self.waiting_on_folder_rename.append(wait_on_folder)
def cleanup_prev_status(self): def cleanup_prev_status(self):