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.

Title: Improvements for shutil.copytree()
Type: Stage:
Components: Library (Lib) Versions:
Status: closed Resolution: accepted
Dependencies: Superseder:
Assigned To: Nosy List: georg.brandl, jlgijsbers, thomaswaldmann
Priority: normal Keywords: patch

Created on 2005-01-01 08:26 by georg.brandl, last changed 2022-04-11 14:56 by admin. This issue is now closed.

File name Uploaded Description Edit
shutil.diff georg.brandl, 2005-01-01 08:26 Patch
Messages (4)
msg47439 - (view) Author: Georg Brandl (georg.brandl) * (Python committer) Date: 2005-01-01 08:26
See bugs #975763 and #1048878.

The patch changes shutil.copytree() to use
os.makedirs() instead of os.mkdir() and to copy
directory bits using copystat(), because file bits are
copied, too.

It includes a doc change to mention these details.
msg47440 - (view) Author: Johannes Gijsbers (jlgijsbers) * (Python triager) Date: 2005-01-08 12:32
Logged In: YES 

Applied on HEAD. Thanks for the patch! Log message:

Checking in Doc/lib/libshutil.tex;
/cvsroot/python/python/dist/src/Doc/lib/libshutil.tex,v  <--
new revision: 1.16; previous revision: 1.15
Checking in Lib/;
/cvsroot/python/python/dist/src/Lib/,v  <--
new revision: 1.35; previous revision: 1.34
msg47441 - (view) Author: Thomas Waldmann (thomaswaldmann) Date: 2005-01-17 00:10
Logged In: YES 

For files, the ctime and atime is copied, too, as part of
copystat() - directly AFTER copying the file.

But if the copystat() call for a directory is done BEFORE
filling that directory with files, the atime and mtime of
the directory will be changed by that again.

So better move the copystat call for the directory to after
the for loop.
msg47442 - (view) Author: Johannes Gijsbers (jlgijsbers) * (Python triager) Date: 2005-01-23 12:21
Logged In: YES 

I see. I've moved the copystat call to after the loop in
rev. 1.36.
Date User Action Args
2022-04-11 14:56:08adminsetgithub: 41385
2005-01-01 08:26:42birkenfeldcreate