Author eric.araujo
Recipients ajaksu2, eric.araujo, georg.brandl, jlgijsbers, mcjeff, tarek, thomaswaldmann
Date 2011-08-09.14:58:25
SpamBayes Score 6.01091e-12
Marked as misclassified No
Message-id <1312901906.71.0.276677957688.issue1666318@psf.upfronthosting.co.za>
In-reply-to
Content
> The result should be uniform; either preserve permissions across the
> board, or leave it to the mercy of the caller.
I’m surprised by this report, as the code does a copystat(sourcedir, targetdir) since 2004 (#1048878).  Anyhow, I think the second option would be better.

>  I know there's an enhancement request already open to supply a
> 'func=' kw argument to copytree.
This is now implemented (copy_function argument), but does not help with directories, only with files.  Recently I needed to call copytree and change the permissions of the destination, so I wanted to use a two-line custom copy_function (one line to call shutil.copy, one line for os.chmod), but I hadn’t understood that the custom function was not used for directory creation.  I found out that shutil does a copystat on the created directories behind my back.  So, I think this problem can be solved in a nice and b/w-compatible way by adding a new keyword argument, makedirs_func.  I would like to fix this in stable versions too, but if another core developer argues that it should be considered a new feature, I won’t argue.
History
Date User Action Args
2011-08-09 14:58:26eric.araujosetrecipients: + eric.araujo, georg.brandl, jlgijsbers, thomaswaldmann, ajaksu2, tarek, mcjeff
2011-08-09 14:58:26eric.araujosetmessageid: <1312901906.71.0.276677957688.issue1666318@psf.upfronthosting.co.za>
2011-08-09 14:58:26eric.araujolinkissue1666318 messages
2011-08-09 14:58:25eric.araujocreate