classification
Title: distutils: ignore .nfsXXXX files
Type: behavior Stage: test needed
Components: Distutils, Distutils2 Versions: Python 3.3, Python 3.2, Python 2.7
process
Status: open Resolution:
Dependencies: Superseder:
Assigned To: tarek Nosy List: SilentGhost, eric.araujo, grobian, haubi, sandro.tosi, tarek, zbysz
Priority: normal Keywords: needs review, patch

Created on 2010-01-16 19:16 by grobian, last changed 2011-12-29 20:39 by zbysz.

Files
File name Uploaded Description Edit
python-2.5.1-distutils-aixnfs.patch grobian, 2010-01-16 19:16 distutils: ignore .nfsXXXXX files
dir_util.py.diff SilentGhost, 2011-02-07 14:43 review
Messages (5)
msg97898 - (view) Author: Fabian Groffen (grobian) Date: 2010-01-16 19:16
NFS on certain platforms (most notably AIX, Solaris) use .nfsXXXXX files that appear and disappear automagically.  distutils can get confused by that once a .nfsXXXXX file was earlier seen with listdir and then removed by the OS before its copied.

Simply ignore .nfsXXXXX files as workaround.
msg128118 - (view) Author: SilentGhost (SilentGhost) Date: 2011-02-07 14:43
Here is the applicable patch against py3k branch.
msg128193 - (view) Author: Éric Araujo (eric.araujo) * (Python committer) Date: 2011-02-08 22:40
Thanks for the report and patch (I think SilentGhost’s version is better).  Do you have any pointer about those .nfs* files?  Are there other (build) tools that ignore them?  Is it always safe to skip .nfs* files, or only .nfs????? (i.e. six characters)?

Aside from those questions, a patch requires a test and doc update.  See guidelines at http://wiki.python.org/moin/Distutils/FixingBugs
msg128195 - (view) Author: Sandro Tosi (sandro.tosi) * (Python committer) Date: 2011-02-08 22:45
On Tue, Feb 8, 2011 at 23:40, Éric Araujo <report@bugs.python.org> wrote:
>
> Éric Araujo <merwok@netwok.org> added the comment:
>
> Do you have any pointer about those .nfs* files?  Are there other (build) tools that ignore them?  Is it always safe to skip .nfs* files, or only .nfs????? (i.e. six characters)?

Just replying for this part: .nfs* files are created by the nfs server
when on of its client removes a file while another client has the very
same file opened. the nfs server keeps the .nfs* file around until the
last client closes the file, after that it removes the .nfs* file.

About the number of digits after '.nfs' I'm not sure there's a
standard for it, but I saw files with more that 6 chars after that.

Regards,
-- 
Sandro Tosi (aka morph, morpheus, matrixhasu)
My website: http://matrixhasu.altervista.org/
Me at Debian: http://wiki.debian.org/SandroTosi
msg150348 - (view) Author: Zbyszek Szmek (zbysz) Date: 2011-12-29 20:39
Review of both patches (python-2.5.1-distutils-aixnfs.patch and dir_util.py.diff) as they are essentially the same:

I think that the test is in wrong place: we would want to ignore those .nfs* files always, not just when checking for symlinks. A separate test
at the top of the loop would be better:
    for n in names:
+       if n.startswith('.nfs'):
+           continue
        src_name = os.path.join(src, n)
        dst_name = os.path.join(dst, n)
        if preserve_symlinks and os.path.islink(src_name):


BTW: under linux 2.6.20 I see files like: .nfs000000000592413900000036, always of this length, with hexadecimal digits after .nfs).
History
Date User Action Args
2011-12-29 20:39:47zbyszsetnosy: + zbysz

messages: + msg150348
versions: + Python 3.3, - 3rd party, Python 3.1
2011-02-08 22:45:51sandro.tosisetnosy: + sandro.tosi
messages: + msg128195
2011-02-08 22:40:56eric.araujosetversions: + 3rd party
nosy: + eric.araujo

messages: + msg128193

components: + Distutils2
2011-02-07 14:43:36SilentGhostsetfiles: + dir_util.py.diff
nosy: + SilentGhost
messages: + msg128118

2011-02-07 13:40:21haubisetnosy: + haubi
2010-07-11 12:10:35BreamoreBoysetversions: + Python 3.1, Python 3.2, - Python 2.6, Python 2.5
2010-01-16 19:36:24brian.curtinsetpriority: normal
keywords: + needs review
stage: test needed
2010-01-16 19:16:43grobiancreate