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.

Author desbma
Recipients desbma
Date 2017-11-18.19:13:26
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1511032407.02.0.213398074469.issue32073@psf.upfronthosting.co.za>
In-reply-to
Content
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
History
Date User Action Args
2017-11-18 19:13:27desbmasetrecipients: + desbma
2017-11-18 19:13:27desbmasetmessageid: <1511032407.02.0.213398074469.issue32073@psf.upfronthosting.co.za>
2017-11-18 19:13:26desbmalinkissue32073 messages
2017-11-18 19:13:26desbmacreate