Branch merge
diff --git a/Doc/distutils/apiref.rst b/Doc/distutils/apiref.rst
index ba4fc9f..60c0dd8 100644
--- a/Doc/distutils/apiref.rst
+++ b/Doc/distutils/apiref.rst
@@ -973,8 +973,8 @@
Copy an entire directory tree *src* to a new location *dst*. Both *src* and
*dst* must be directory names. If *src* is not a directory, raise
:exc:`DistutilsFileError`. If *dst* does not exist, it is created with
- :func:`mkpath`. The end result of the copy is that every file in *src* is
- copied to *dst*, and directories under *src* are recursively copied to *dst*.
+ :func:`mkpath`. The end result of the copy is that every file in *src* is
+ copied to *dst*, and directories under *src* are recursively copied to *dst*.
Return the list of files that were copied or might have been copied, using their
output name. The return value is unaffected by *update* or *dry_run*: it is
simply the list of all files under *src*, with the names changed to be under
@@ -987,6 +987,10 @@
destination of the symlink will be copied. *update* and *verbose* are the same
as for :func:`copy_file`.
+ Files in *src* that begin with :file:`.nfs` are skipped (more information on
+ these files is available in answer D2 of the `NFS FAQ page
+ <http://nfs.sourceforge.net/#section_d>`_.
+
.. function:: remove_tree(directory[, verbose=0, dry_run=0])
diff --git a/Doc/distutils/sourcedist.rst b/Doc/distutils/sourcedist.rst
index a9858d0..b1695a2 100644
--- a/Doc/distutils/sourcedist.rst
+++ b/Doc/distutils/sourcedist.rst
@@ -51,8 +51,7 @@
of the standard Python library since Python 1.6)
(4)
- requires the :program:`compress` program. Notice that this format is now
- pending for deprecation and will be removed in the future versions of Python.
+ requires the :program:`compress` program.
When using any ``tar`` format (``gztar``, ``bztar``, ``ztar`` or
``tar``) under Unix, you can specify the ``owner`` and ``group`` names
diff --git a/Doc/library/csv.rst b/Doc/library/csv.rst
index 33b39f2..1978547 100644
--- a/Doc/library/csv.rst
+++ b/Doc/library/csv.rst
@@ -40,7 +40,7 @@
This version of the :mod:`csv` module doesn't support Unicode input. Also,
there are currently some issues regarding ASCII NUL characters. Accordingly,
all input should be UTF-8 or printable ASCII to be safe; see the examples in
- section :ref:`csv-examples`. These restrictions will be removed in the future.
+ section :ref:`csv-examples`.
.. seealso::
diff --git a/Doc/library/fpectl.rst b/Doc/library/fpectl.rst
index ef030f0..8ca671b 100644
--- a/Doc/library/fpectl.rst
+++ b/Doc/library/fpectl.rst
@@ -113,8 +113,8 @@
.. seealso::
Some files in the source distribution may be interesting in learning more about
- how this module operates. The include file :file:`Include/pyfpe.h` discusses the
- implementation of this module at some length. :file:`Modules/fpetestmodule.c`
+ how this module operates. The include file :source:`Include/pyfpe.h` discusses the
+ implementation of this module at some length. :source:`Modules/fpetestmodule.c`
gives several examples of use. Many additional examples can be found in
- :file:`Objects/floatobject.c`.
+ :source:`Objects/floatobject.c`.
diff --git a/Doc/library/mailbox.rst b/Doc/library/mailbox.rst
index 54ade5a..a5d2aa0 100644
--- a/Doc/library/mailbox.rst
+++ b/Doc/library/mailbox.rst
@@ -1513,7 +1513,7 @@
mailboxes, such as adding or removing message, and do not provide classes to
represent format-specific message properties. For backward compatibility, the
older mailbox classes are still available, but the newer classes should be used
-in preference to them. The old classes will be removed in Python 3.
+in preference to them. The old classes have been removed in Python 3.
Older mailbox objects support only iteration and provide a single public method:
diff --git a/Doc/library/parser.rst b/Doc/library/parser.rst
index e2d4523..acda372 100644
--- a/Doc/library/parser.rst
+++ b/Doc/library/parser.rst
@@ -34,7 +34,7 @@
replaced by "ast"; this is a legacy from the time when there was no other
AST and has nothing to do with the AST found in Python 2.5. This is also the
reason for the functions' keyword arguments being called *ast*, not *st*.
- The "ast" functions will be removed in Python 3.
+ The "ast" functions have been removed in Python 3.
There are a few things to note about this module which are important to making
use of the data structures created. This is not a tutorial on editing the parse
diff --git a/Lib/distutils/dir_util.py b/Lib/distutils/dir_util.py
index 9c5cf33..5026e24 100644
--- a/Lib/distutils/dir_util.py
+++ b/Lib/distutils/dir_util.py
@@ -144,6 +144,10 @@
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:
diff --git a/Lib/distutils/tests/test_dir_util.py b/Lib/distutils/tests/test_dir_util.py
index 693f77c..d82d913 100644
--- a/Lib/distutils/tests/test_dir_util.py
+++ b/Lib/distutils/tests/test_dir_util.py
@@ -101,6 +101,24 @@
remove_tree(self.root_target, verbose=0)
remove_tree(self.target2, verbose=0)
+ def test_copy_tree_skips_nfs_temp_files(self):
+ mkpath(self.target, verbose=0)
+
+ a_file = os.path.join(self.target, 'ok.txt')
+ nfs_file = os.path.join(self.target, '.nfs123abc')
+ for f in a_file, nfs_file:
+ fh = open(f, 'w')
+ try:
+ fh.write('some content')
+ finally:
+ fh.close()
+
+ copy_tree(self.target, self.target2)
+ self.assertEqual(os.listdir(self.target2), ['ok.txt'])
+
+ remove_tree(self.root_target, verbose=0)
+ remove_tree(self.target2, verbose=0)
+
def test_ensure_relative(self):
if os.sep == '/':
self.assertEqual(ensure_relative('/home/foo'), 'home/foo')
diff --git a/Lib/distutils/tests/test_sdist.py b/Lib/distutils/tests/test_sdist.py
index 3a89f73..7e7d98d 100644
--- a/Lib/distutils/tests/test_sdist.py
+++ b/Lib/distutils/tests/test_sdist.py
@@ -91,9 +91,8 @@
@unittest.skipUnless(zlib, "requires zlib")
def test_prune_file_list(self):
- # this test creates a package with some vcs dirs in it
- # and launch sdist to make sure they get pruned
- # on all systems
+ # this test creates a project with some VCS dirs and an NFS rename
+ # file, then launches sdist to check they get pruned on all systems
# creating VCS directories with some files in them
os.mkdir(join(self.tmp_dir, 'somecode', '.svn'))
@@ -107,6 +106,8 @@
self.write_file((self.tmp_dir, 'somecode', '.git',
'ok'), 'xxx')
+ self.write_file((self.tmp_dir, 'somecode', '.nfs0001'), 'xxx')
+
# now building a sdist
dist, cmd = self.get_cmd()
diff --git a/Misc/ACKS b/Misc/ACKS
index e1adbe7..fed0553 100644
--- a/Misc/ACKS
+++ b/Misc/ACKS
@@ -688,6 +688,7 @@
Brian Quinlan
Anders Qvist
Burton Radons
+Jeff Ramnani
Brodie Rao
Antti Rasinen
Sridhar Ratnakumar
diff --git a/Misc/NEWS b/Misc/NEWS
index 94da277..063a6db 100644
--- a/Misc/NEWS
+++ b/Misc/NEWS
@@ -14,6 +14,9 @@
longer raised due to a read system call returning EINTR from within these
methods.
+- Issue #7719: Make distutils ignore ``.nfs*`` files instead of choking later
+ on. Initial patch by SilentGhost and Jeff Ramnani.
+
- Issue #10053: Don't close FDs when FileIO.__init__ fails. Loosely based on
the work by Hirokazu Yamamoto.
diff --git a/Tools/scripts/byext.py b/Tools/scripts/byext.py
index 138d8dd..ca18776 100755
--- a/Tools/scripts/byext.py
+++ b/Tools/scripts/byext.py
@@ -2,6 +2,8 @@
"""Show file statistics by extension."""
+from __future__ import print_function
+
import os
import sys