Fix renaming folders on libtorrent 0.16 compiled with unicode support (Windows)
This commit is contained in:
parent
92eb9feae4
commit
c58221c866
|
@ -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):
|
||||||
|
|
Loading…
Reference in New Issue