[New-bugs-announce] [issue19840] The is no way to tell shutil.move to ignore metadata

zodalahtathi report at bugs.python.org
Sat Nov 30 14:05:40 CET 2013


New submission from zodalahtathi:

shutil.move sometimes fail when the underlining filesystem has limitations.

Here is a part of a stacktrace I'm getting :

  File "/usr/local/lib/python3.3/shutil.py", line 534, in move
    copy2(src, real_dst)
  File "/usr/local/lib/python3.3/shutil.py", line 244, in copy2
    copystat(src, dst, follow_symlinks=follow_symlinks)
  File "/usr/local/lib/python3.3/shutil.py", line 192, in copystat
    lookup("chmod")(dst, mode, follow_symlinks=follow)
OSError: [Errno 38]

This behaviour is expected because shutil.move uses shutil.copy2 under the hood to copy file data and metadata.

However there is no way to tell shutil.move to use shutil.copy and to ignore metadata.

Maybe a new copy_metadata parameter (defaulting to True) or copy_function (like in shutil.copytree) would be an elegant solution?

----------
components: Library (Lib)
messages: 204807
nosy: zodalahtathi
priority: normal
severity: normal
status: open
title: The is no way to tell shutil.move to ignore metadata
type: enhancement
versions: Python 3.3

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


More information about the New-bugs-announce mailing list