summaryrefslogtreecommitdiffstats
path: root/Lib/distutils/dir_util.py
diff options
context:
space:
mode:
authorÉric Araujo <aeric@mtlpy.org>2012-12-08 19:21:51 (GMT)
committerÉric Araujo <aeric@mtlpy.org>2012-12-08 19:21:51 (GMT)
commit3e4a3dcb23d849fa0ce5f5009e83606abaef15aa (patch)
tree41475986d38a6d9ecdcacb93a3205a164137501f /Lib/distutils/dir_util.py
parent09974b4e9e8da3c9ba0469f4812e68cf9f700ffd (diff)
downloadcpython-3e4a3dcb23d849fa0ce5f5009e83606abaef15aa.zip
cpython-3e4a3dcb23d849fa0ce5f5009e83606abaef15aa.tar.gz
cpython-3e4a3dcb23d849fa0ce5f5009e83606abaef15aa.tar.bz2
Ignore .nfs* files in distutils (#7719).
These files are created by some NFS clients a file is edited and removed concurrently (see added link in doc for more info). If such a file is removed between distutils calls listdir and copy, it will get confused. Other special files are ignored in sdist (namely VCS directories), but this has to be filtered out earlier.
Diffstat (limited to 'Lib/distutils/dir_util.py')
-rw-r--r--Lib/distutils/dir_util.py4
1 files changed, 4 insertions, 0 deletions
diff --git a/Lib/distutils/dir_util.py b/Lib/distutils/dir_util.py
index 30daf49..2826ff8 100644
--- a/Lib/distutils/dir_util.py
+++ b/Lib/distutils/dir_util.py
@@ -141,6 +141,10 @@ def copy_tree(src, dst, preserve_mode=1, preserve_times=1,
src_name = os.path.join(src, n)
dst_name = os.path.join(dst, n)
+ if n.startswith('.nfs'):
+ # skip NFS rename files
+ continue
+
if preserve_symlinks and os.path.islink(src_name):
link_dest = os.readlink(src_name)
if verbose >= 1: