From 58adbe94b9e6ae363bf1dc2e6ab18dd7427d16e5 Mon Sep 17 00:00:00 2001 From: Calum Lind Date: Sun, 25 Sep 2011 18:14:33 +0100 Subject: [PATCH] Fix #1940 : File & folder renaming issue when using Add Torrent dialog in Windows The file rename in torrentmanager was calling lt.rename_file directly so skipping the sanitize function normally applied when renaming. --- deluge/core/torrentmanager.py | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/deluge/core/torrentmanager.py b/deluge/core/torrentmanager.py index 3f95bb014..2cfc29168 100644 --- a/deluge/core/torrentmanager.py +++ b/deluge/core/torrentmanager.py @@ -450,9 +450,10 @@ class TorrentManager(component.Component): # Check for renamed files and if so, rename them in the torrent_info # before adding to the session. 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, utf8_encoded(name)) + for index, filename in options["mapped_files"].items(): + filename = deluge.core.torrent.sanitize_filepath(filename) + log.debug("renaming file index %s to %s", index, filename) + torrent_info.rename_file(index, utf8_encoded(filename)) add_torrent_params["ti"] = torrent_info