From 1f6127160ce46291812ca455b98eccb98413bca8 Mon Sep 17 00:00:00 2001 From: Marcos Pinto Date: Sun, 10 Jun 2007 01:03:30 +0000 Subject: [PATCH] fix shutil.copy() exception. ticket #308 - regulate --- src/core.py | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/src/core.py b/src/core.py index 9d68695f3..290af286d 100644 --- a/src/core.py +++ b/src/core.py @@ -593,7 +593,13 @@ class Manager: full_new_name = os.path.join(self.base_dir, TORRENTS_SUBDIR, filename_short) - shutil.copy(filename, full_new_name) + try: + shutil.copy(filename, full_new_name) + except Exception, e: + if str(e).find('are the same file'): + pass + else: + raise # Create torrent object new_torrent = torrent_info(full_new_name, save_dir, compact)