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.

Title: "copytree" refuses to copy to a mount point
Type: behavior Stage: resolved
Components: Distutils Versions: Python 3.6
Status: closed Resolution: out of date
Dependencies: Superseder:
Assigned To: Nosy List: dstufft, eric.araujo, james_r_c_stevens, steve.dower
Priority: normal Keywords:

Created on 2018-06-26 12:04 by james_r_c_stevens, last changed 2022-04-11 14:59 by admin. This issue is now closed.

Messages (2)
msg320487 - (view) Author: James Stevens (james_r_c_stevens) * Date: 2018-06-26 12:04
Even if the mount-point directory is empty, "copytree" refuses to copy to a it becuase it will not perform a copy if the destination directory already exists - although it will accept any of the parents of destination existing, or not. Therefore, "copytree" is unable to copy to the top directory of (say) a USB Stick.

This also means "copytree" can't be used to merge the contents of two source directories into a single destination. etc,etc

This one flaw means that the use scenarios for "copytree" are actually extremely limited when compared to (say) "cp" - but running "["cp","-a",...])" as commonly recommended on StackOverflow is not an ideal solution for lots of reasons.
msg386337 - (view) Author: Steve Dower (steve.dower) * (Python committer) Date: 2021-02-03 18:19
Distutils is now deprecated (see PEP 632) and all tagged issues are being closed. From now until removal, only release blocking issues will be considered for distutils.

If this issue does not relate to distutils, please remove the component and reopen it. If you believe it still requires a fix, most likely the issue should be re-reported at
Date User Action Args
2022-04-11 14:59:02adminsetgithub: 78150
2021-02-03 18:19:27steve.dowersetstatus: open -> closed

nosy: + steve.dower
messages: + msg386337

resolution: out of date
stage: resolved
2018-06-26 12:04:51james_r_c_stevenscreate