[New-bugs-announce] [issue14662] shutil.move broken in 2.7.3 on OSX (chflags fails)

Fabian Groffen report at bugs.python.org
Tue Apr 24 19:58:52 CEST 2012

New submission from Fabian Groffen <grobian at gentoo.org>:

With current working dir an NFS-mounted ZFS share, and /var/tmp (OSX default) HFS+:

% echo "test" > /var/tmp/testfile
% python
Python 2.7.3 (default, Apr 24 2012, 19:33:45) 
[GCC 4.2.1 (Gentoo 4.2.1_p5666, Apple Inc. build 5666) (dot 3)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> import shutil
>>> shutil.move("/var/tmp/testfile", "./testfile");
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/Library/Gentoo/usr/lib/python2.7/shutil.py", line 299, in move
    copy2(src, real_dst)
  File "/Library/Gentoo/usr/lib/python2.7/shutil.py", line 129, in copy2
    copystat(src, dst)
  File "/Library/Gentoo/usr/lib/python2.7/shutil.py", line 103, in copystat
    os.chflags(dst, st.st_flags)
OSError: [Errno 45] Operation not supported: './testfile'
% ls /var/tmp/testfile ./testfile
./testfile  /var/tmp/testfile

The problem likely is that the flags stored on the HFS+ volume cannot be applied to the NFS-mounted ZFS volume.  This likely also occurs when doing a bit more regular things, like e.g. moving/copying to a mounted USB disk (with FAT32 filesystem).

I believe this is a "regression" introduced by http://bugs.python.org/issue8746.  Python-2.7.2 works fine.

While preserving flags is nice, it is questionable whether failure to do so in this case is worth dying for.  In particular, leaving behind both the original as well as the copy is a bit messy.

components: None
messages: 159178
nosy: grobian
priority: normal
severity: normal
status: open
title: shutil.move broken in 2.7.3 on OSX (chflags fails)
type: behavior
versions: Python 2.7

Python tracker <report at bugs.python.org>

More information about the New-bugs-announce mailing list