This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author hans-meine
Recipients hans-meine
Date 2019-05-08.07:43:31
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1557301411.76.0.646767757374.issue36850@roundup.psfhosted.org>
In-reply-to
Content
This is a near duplicate of #24564, but has a slightly smaller scope.

We're using a CIFS filesystem and noticed that copying files *from* that filesystem to a local path with `shutil.copy2` does not work, but fails with an `OSError: [Errno 22] Invalid argument`.  This is because `copy2()` calls `copystat()` which contains

    try:
        names = os.listxattr(src, follow_symlinks=follow_symlinks)
    except OSError as e:
        if e.errno not in (errno.ENOTSUP, errno.ENODATA):
            raise

In our case with our CIFS mount, and in the NFS mounts mentioned in #24564, `os.listxattr()` raises an IOError with `errno.EINVAL` (22).  It was proposed in #24564 already to also ignore EINVAL, but with this issue I wanted to specifically propose to do so for the *reading* part.  While I also think that copy2() should work with both source *and* target filesystems not supporting xattr, our use case where the likelihood of data loss is zero (because there have never been xattr in the first place) is particularly annoying.
History
Date User Action Args
2019-05-08 07:43:31hans-meinesetrecipients: + hans-meine
2019-05-08 07:43:31hans-meinesetmessageid: <1557301411.76.0.646767757374.issue36850@roundup.psfhosted.org>
2019-05-08 07:43:31hans-meinelinkissue36850 messages
2019-05-08 07:43:31hans-meinecreate