[New-bugs-announce] [issue24564] shutil.copytree fails when copying NFS to NFS

Jess Hamrick report at bugs.python.org
Sat Jul 4 22:05:50 CEST 2015


New submission from Jess Hamrick:

shutil.copytree seems to fail when copying files across NFS filesystems. In this example (see bug_demo.py), /tmp is a normal ext4 filesystem and the current working directory is NFS (version 4). Interestingly, it works fine to to copy between ext4 and NFS, just not NFS and NFS (even if it's the same NFS mount).

Depending on the specific version of 3.4, there are slightly different errors. For 3.4.0:

$ uname -a
Linux compmodels-node 3.13.0-55-generic #94-Ubuntu SMP Thu Jun 18 00:27:10 UTC 2015 x86_64 x86_64 x86_64 GNU/Linux
$ python3 bug_demo.py

--------------------------------------------------
Python version info:
3.4.0 (default, Jun 19 2015, 14:20:21)
[GCC 4.8.2]
--------------------------------------------------

Copying NFS --> /tmp
Copying /tmp --> NFS
Copying NFS --> NFS
Traceback (most recent call last):
  File "/usr/lib/python3.4/shutil.py", line 336, in copytree
    copystat(src, dst)
  File "/usr/lib/python3.4/shutil.py", line 212, in copystat
    _copyxattr(src, dst, follow_symlinks=follow)
  File "/usr/lib/python3.4/shutil.py", line 152, in _copyxattr
    os.setxattr(dst, name, value, follow_symlinks=follow_symlinks)
OSError: [Errno 22] Invalid argument: 'demo_files3'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "bug_demo.py", line 27, in <module>
    shutil.copytree('demo_files', 'demo_files3')
  File "/usr/lib/python3.4/shutil.py", line 339, in copytree
    if why.winerror is None:
AttributeError: 'OSError' object has no attribute 'winerror'


And for 3.4.3:

$ uname -a
Linux compmodels-node-02 3.19.0-21-generic #21-Ubuntu SMP Sun Jun 14 18:31:11 UTC 2015 x86_64 x86_64 x86_64 GNU/Linux
$ python3 bug_demo.py

--------------------------------------------------
Python version info:
3.4.3 (default, Mar 26 2015, 22:03:40)
[GCC 4.9.2]
--------------------------------------------------

Copying NFS --> /tmp
Copying /tmp --> NFS
Copying NFS --> NFS
Traceback (most recent call last):
  File "bug_demo.py", line 27, in <module>
    shutil.copytree('demo_files', 'demo_files3')
  File "/usr/lib/python3.4/shutil.py", line 343, in copytree
    raise Error(errors)
shutil.Error: [('demo_files', 'demo_files3', "[Errno 22] Invalid argument: 'demo_files3'")]


This is probably related to https://bugs.python.org/issue17076 and my guess is that's also why there is a difference in the error messages between 3.4.0 and 3.4.3.

----------
files: bug_demo.py
messages: 246272
nosy: jhamrick
priority: normal
severity: normal
status: open
title: shutil.copytree fails when copying NFS to NFS
type: crash
versions: Python 3.4
Added file: http://bugs.python.org/file39864/bug_demo.py

_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue24564>
_______________________________________


More information about the New-bugs-announce mailing list