Author Gerrit.Holl
Recipients Gerrit.Holl
Date 2015-06-30.12:07:20
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1435666041.75.0.103684760482.issue24538@psf.upfronthosting.co.za>
In-reply-to
Content
`shutil.copystat` fails on [panfs](https://en.wikipedia.org/wiki/Panasas#PanFS) if the source file lacks u+w, because setting extended attributes results in a `PermissionError`.  This leads to higher end functions such as `shutil.copytree` to fail.  More seriously, it leads to `pip install .` to fail, as I [reported here](https://github.com/pypa/pip/issues/2941):

    In [55]: shutil.copystat("/src/on/panfs", "/tmp/fubar")
    ---------------------------------------------------------------------------
    PermissionError                           Traceback (most recent call last)
    <ipython-input-55-139c9fc77184> in <module>()
    ----> 1 shutil.copystat("/home/users/gholl/checkouts/pyatmlab/.git/objects/pack/pack-c1449559ec4287b3830efe2913608dddf2f21391.pack", "/tmp/fubar")
    
    /home/users/gholl/lib/python3.4/shutil.py in copystat(src, dst, follow_symlinks)
        211             else:
        212                 raise
    --> 213     _copyxattr(src, dst, follow_symlinks=follow)
        214
        215 def copy(src, dst, *, follow_symlinks=True):
    
    /home/users/gholl/lib/python3.4/shutil.py in _copyxattr(src, dst, follow_symlinks)
        151             try:
        152                 value = os.getxattr(src, name, follow_symlinks=follow_symlinks)
    --> 153                 os.setxattr(dst, name, value, follow_symlinks=follow_symlinks)
        154             except OSError as e:
        155                 if e.errno not in (errno.EPERM, errno.ENOTSUP, errno.ENODATA):
    
    PermissionError: [Errno 13] Permission denied: '/tmp/fubar'

This occurs for any source file where the user write bit is not set.

Now, I'm not sure if this should be addressed in `pip`, `shutil.copytree`, `shutil.copystat`, `setxattr`, `panfs`, or in none of the above.  I'm reporting it in different places; please close this issue if this is the wrong place.
History
Date User Action Args
2015-06-30 12:07:21Gerrit.Hollsetrecipients: + Gerrit.Holl
2015-06-30 12:07:21Gerrit.Hollsetmessageid: <1435666041.75.0.103684760482.issue24538@psf.upfronthosting.co.za>
2015-06-30 12:07:21Gerrit.Holllinkissue24538 messages
2015-06-30 12:07:20Gerrit.Hollcreate