[New-bugs-announce] [issue12461] it's not clear how the shutil.copystat() should work on symlinks

Марк Коренберг report at bugs.python.org
Fri Jul 1 11:42:38 CEST 2011


New submission from Марк Коренберг <socketpair at gmail.com>:

According to
http://hg.python.org/cpython/file/588fe0fc7160/Lib/shutil.py

it uses utimes(), stat() ans so on,
For some people, it's preferable to use lutimes() and lstat(),but for some people it's not.

For example, in old implementation, exception will raise on broken symlink during os.utime().

Also, copystat() does not check that chown can not be applied to a symlink.

I do not think that it's good to add two parameters like
shutil.copystat(src, dst, followsrc, followdst)

Adding just one parameter (followsymlinks) is not sufficient.

----------
components: Library (Lib)
messages: 139561
nosy: mmarkk
priority: normal
severity: normal
status: open
title: it's not clear how the shutil.copystat() should work on symlinks
type: behavior
versions: Python 2.6, Python 2.7, Python 3.1, Python 3.2, Python 3.3

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


More information about the New-bugs-announce mailing list