diff options
Diffstat (limited to 'Lib/shutil.py')
-rw-r--r-- | Lib/shutil.py | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/Lib/shutil.py b/Lib/shutil.py index 3076be92e1..0e60870957 100644 --- a/Lib/shutil.py +++ b/Lib/shutil.py @@ -24,6 +24,11 @@ def copyfile(src, dst): """Copy data from src to dst""" fsrc = None fdst = None + # check for same pathname; all platforms + _src = os.path.normcase(os.path.abspath(src)) + _dst = os.path.normcase(os.path.abspath(dst)) + if _src == _dst: + return try: fsrc = open(src, 'rb') fdst = open(dst, 'wb') |