This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author zooko
Recipients
Date 2006-05-22.03:08:36
SpamBayes Score
Marked as misclassified
Message-id
In-reply-to
Content
I need to call shutil.move() and be able to tell the
difference between an error such as access denied and
an error due to the two arguments being the same file.


--- old-dw/src/Lib/shutil.py    2006-05-22
00:06:02.000000000 -0300
+++ new-dw/src/Lib/shutil.py    2006-05-22
00:06:02.000000000 -0300
@@ -16,6 +16,9 @@
 class Error(exceptions.EnvironmentError):
     pass

+class SameFileError(Error):
+    pass
+
 def copyfileobj(fsrc, fdst, length=16*1024):
     """copy data from file-like object fsrc to
file-like object fdst"""
     while 1:
@@ -39,7 +42,7 @@
 def copyfile(src, dst):
     """Copy data from src to dst"""
     if _samefile(src, dst):
-        raise Error, "`%s` and `%s` are the same file"
% (src, dst)
+        raise SameFileError, "`%s` and `%s` are the
same file" % (src, dst)

     fsrc = None
     fdst = None

History
Date User Action Args
2007-08-23 15:49:02adminlinkissue1492704 messages
2007-08-23 15:49:02admincreate