Issue #4616: TarFile.utime(): Restore directory times on Windows.

This commit is contained in:
Lars Gustäbel 2008-12-12 13:58:03 +00:00
parent 4c96fa5525
commit 3b02742f7d
3 changed files with 5 additions and 10 deletions

View file

@ -2284,10 +2284,6 @@ class TarFile(object):
"""
if not hasattr(os, 'utime'):
return
if sys.platform == "win32" and tarinfo.isdir():
# According to msdn.microsoft.com, it is an error (EACCES)
# to use utime() on directories.
return
try:
os.utime(targetpath, (tarinfo.mtime, tarinfo.mtime))
except EnvironmentError, e: