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.
Logged In: YES user_id=100649 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.