[issue26468] shutil.copy2 raises OSError if filesystem doesn't support chmod

Vojtěch Pachol added the comment: Actually it is a remote fs mounted via samba. OS is Linux. Tracebacks with Python versions I have: $ python2.7 Python 2.7.11 (default, Jan 11 2016, 21:04:40) [GCC 5.3.1 20160101] on linux2 Type "help", "copyright", "credits" or "license" for more information.
import shutil shutil.copy2("src", "dst") Traceback (most recent call last): File "<stdin>", line 1, in <module> File "/usr/lib/python2.7/shutil.py", line 131, in copy2 copystat(src, dst) File "/usr/lib/python2.7/shutil.py", line 100, in copystat os.chmod(dst, mode) OSError: [Errno 95] Operation not supported: 'dst'
$ python3.4 Python 3.4.4 (default, Jan 5 2016, 15:35:18) [GCC 5.3.1 20160101] on linux Type "help", "copyright", "credits" or "license" for more information.
import shutil shutil.copy2("src", "dst") Traceback (most recent call last): File "<stdin>", line 1, in <module> File "/usr/lib/python3.4/shutil.py", line 246, in copy2 copystat(src, dst, follow_symlinks=follow_symlinks) File "/usr/lib/python3.4/shutil.py", line 191, in copystat lookup("chmod")(dst, mode, follow_symlinks=follow) OSError: [Errno 95] Operation not supported: 'dst'
$ python3.5 Python 3.5.1+ (default, Jan 13 2016, 15:09:18) [GCC 5.3.1 20160101] on linux Type "help", "copyright", "credits" or "license" for more information.
import shutil shutil.copy2("src", "dst") Traceback (most recent call last): File "<stdin>", line 1, in <module> File "/usr/lib/python3.5/shutil.py", line 252, in copy2 copystat(src, dst, follow_symlinks=follow_symlinks) File "/usr/lib/python3.5/shutil.py", line 197, in copystat lookup("chmod")(dst, mode, follow_symlinks=follow) OSError: [Errno 95] Operation not supported: 'dst'
---------- _______________________________________ Python tracker <report@bugs.python.org> <http://bugs.python.org/issue26468> _______________________________________
participants (1)
-
Vojtěch Pachol