diff --git a/deluge/core/torrent.py b/deluge/core/torrent.py index 697401e5d..a9e621f82 100644 --- a/deluge/core/torrent.py +++ b/deluge/core/torrent.py @@ -816,7 +816,7 @@ class Torrent: """Renames files in the torrent. 'filenames' should be a list of (index, filename) pairs.""" for index, filename in filenames: - self.handle.rename_file(index, filename) + self.handle.rename_file(index, filename.encode("utf-8")) def rename_folder(self, folder, new_folder): """Renames a folder within a torrent. This basically does a file rename @@ -834,5 +834,5 @@ class Torrent: if f["path"].startswith(folder): # Keep a list of filerenames we're waiting on wait_on_folder[2].append(f["index"]) - self.handle.rename_file(f["index"], f["path"].replace(folder, new_folder, 1)) + self.handle.rename_file(f["index"], f["path"].replace(folder, new_folder, 1).encode("utf-8")) self.waiting_on_folder_rename.append(wait_on_folder) diff --git a/deluge/core/torrentmanager.py b/deluge/core/torrentmanager.py index 11fc2f3ef..883178123 100644 --- a/deluge/core/torrentmanager.py +++ b/deluge/core/torrentmanager.py @@ -381,7 +381,7 @@ class TorrentManager(component.Component): if options["mapped_files"]: for index, name in options["mapped_files"].items(): log.debug("renaming file index %s to %s", index, name) - torrent_info.rename_file(index, name) + torrent_info.rename_file(index, name.encode("utf-8")) add_torrent_params["ti"] = torrent_info add_torrent_params["resume_data"] = ""