This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

classification
Title: it's not clear how the shutil.copystat() should work on symlinks
Type: Stage: resolved
Components: Library (Lib) Versions: Python 3.1, Python 3.2, Python 3.3, Python 2.7, Python 2.6
process
Status: closed Resolution: duplicate
Dependencies: Superseder: Add symlink support to shutil functions
View: 12715
Assigned To: Nosy List: eric.araujo, hynek, petri.lehtinen, socketpair
Priority: normal Keywords:

Created on 2011-07-01 09:42 by socketpair, last changed 2022-04-11 14:57 by admin. This issue is now closed.

Messages (3)
msg139561 - (view) Author: Марк Коренберг (socketpair) * Date: 2011-07-01 09:42
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.
msg142603 - (view) Author: Hynek Schlawack (hynek) * (Python committer) Date: 2011-08-21 09:44
This is a sub-issue of #12715.

ATM the consent is to add just one symlinks parameter and use the l* functions iff src _and_ dst are symlinks.
msg142606 - (view) Author: Éric Araujo (eric.araujo) * (Python committer) Date: 2011-08-21 10:21
This report is older but the other one has more discussion and patches, so I’m closing this one.  You’re welcome to follow the other.  If you think the documentation for current versions should mention how symlinks are handled, please open a new documentation bug.
History
Date User Action Args
2022-04-11 14:57:19adminsetgithub: 56670
2011-08-21 10:21:11eric.araujosetstatus: open -> closed

superseder: Add symlink support to shutil functions
type: behavior ->

nosy: + eric.araujo
messages: + msg142606
resolution: duplicate
stage: resolved
2011-08-21 09:44:16hyneksetnosy: + hynek
messages: + msg142603
2011-07-03 20:08:32petri.lehtinensetnosy: + petri.lehtinen
2011-07-01 09:42:37socketpaircreate