From: Guido van Rossum Date: Thu, 14 Jan 1999 00:42:00 +0000 (+0000) Subject: Change the order of the utime() and the chmod() call in copystat(). X-Git-Tag: v1.5.2b2~356 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=e1bf7e8c1d5ec4e16a7dc772e3e6091e773e5007;p=python Change the order of the utime() and the chmod() call in copystat(). This doesn't make a bit of difference on Unix, but apparently on Windows NT you need write permission before you can set the utime... --- diff --git a/Lib/shutil.py b/Lib/shutil.py index a248c6e90a..b44a069446 100644 --- a/Lib/shutil.py +++ b/Lib/shutil.py @@ -36,8 +36,8 @@ def copystat(src, dst): """Copy all stat info (mode bits, atime and mtime) from src to dst""" st = os.stat(src) mode = stat.S_IMODE(st[stat.ST_MODE]) - os.chmod(dst, mode) os.utime(dst, (st[stat.ST_ATIME], st[stat.ST_MTIME])) + os.chmod(dst, mode) def copy(src, dst):