Message306494
I am sometimes using shutil.copytree to copy a directory to a destination that does not support setting metadata (like MTP mounts of Android devices).
Using the copy_function parameter allows passing shutil.copy or a custom function to ignore file metadata, however currently shutil.copytree always tries to call copystat on directories, which can fail with OSError (errno set to ENOTSUPP).
The code assumes copystat can fail on Windows, but propagates the error on other OS, even though the tree copy actually succeeds.
See https://github.com/python/cpython/blob/9bb6fe52742340f6c92f0dda18599a4577a94e18/Lib/shutil.py#L352-L357 |
|
Date |
User |
Action |
Args |
2017-11-18 19:13:27 | desbma | set | recipients:
+ desbma |
2017-11-18 19:13:27 | desbma | set | messageid: <1511032407.02.0.213398074469.issue32073@psf.upfronthosting.co.za> |
2017-11-18 19:13:26 | desbma | link | issue32073 messages |
2017-11-18 19:13:26 | desbma | create | |
|