Message141822
> 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. |
|
Date |
User |
Action |
Args |
2011-08-09 14:58:26 | eric.araujo | set | recipients:
+ eric.araujo, georg.brandl, jlgijsbers, thomaswaldmann, ajaksu2, tarek, mcjeff |
2011-08-09 14:58:26 | eric.araujo | set | messageid: <1312901906.71.0.276677957688.issue1666318@psf.upfronthosting.co.za> |
2011-08-09 14:58:26 | eric.araujo | link | issue1666318 messages |
2011-08-09 14:58:25 | eric.araujo | create | |
|