From 4b2dae29d4f33e958618ef4916b7a26eecbc7f5e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jonas=20Borgstr=C3=B6m?= Date: Tue, 1 Jul 2014 21:28:07 +0200 Subject: [PATCH] Fix incorrect detect of follow_symlinks support This only affects system with Python 3.3+ and a really old libc --- attic/archive.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/attic/archive.py b/attic/archive.py index e796d71af..62aa5ca18 100644 --- a/attic/archive.py +++ b/attic/archive.py @@ -26,6 +26,7 @@ WINDOW_SIZE = 0xfff CHUNK_MASK = 0xffff utime_supports_fd = os.utime in getattr(os, 'supports_fd', {}) +utime_supports_follow_symlinks = os.utime in getattr(os, 'supports_follow_symlinks', {}) has_mtime_ns = sys.version >= '3.3' has_lchmod = hasattr(os, 'lchmod') has_lchflags = hasattr(os, 'lchflags') @@ -314,7 +315,7 @@ class Archive: mtime = bigint_to_int(item[b'mtime']) if fd and utime_supports_fd: # Python >= 3.3 os.utime(fd, None, ns=(mtime, mtime)) - elif utime_supports_fd: # Python >= 3.3 + elif utime_supports_follow_symlinks: # Python >= 3.3 os.utime(path, None, ns=(mtime, mtime), follow_symlinks=False) elif not symlink: os.utime(path, (mtime / 1e9, mtime / 1e9))