Author giampaolo.rodola
Recipients elias, eric.araujo, giampaolo.rodola, hynek, justin.myers, ncoghlan, r.david.murray, tarek, thehesiod
Date 2018-08-16.22:22:20
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1534458140.39.0.56676864532.issue20849@psf.upfronthosting.co.za>
In-reply-to
Content
I think this feature request is reasonable for 2 reasons:

1) As it stands if dst directory exists copytree() cannot be used. The only possible workaround is using rmtree(dst) first, but that doesn't seem to make much sense. The change may look extremely easy but the fact that copytree() cannot be used in a specific circumstance justifies the cost of introducing a new argument, basically because there is no other way around it.

2) "cp -r" does this by default, which is probably indicative (I don't think the default should be True though).

I think the new argument should be called "dirs_exists_ok" instead of "exists_ok" though, so that it's clear that the behavior does not affect files.

[ R. David Murray ]
> I do not think that *just* making it OK for the destination directory to exist would be a good API.

I don't think that refusing (or allowing) to copy existing files is a common enough use case to justify the addition of a new parameter (note: also "cp" does not provide this use case). If such a  behavior is desired the user can simply provide its own custom "copy_function".
History
Date User Action Args
2018-08-16 22:22:20giampaolo.rodolasetrecipients: + giampaolo.rodola, ncoghlan, tarek, eric.araujo, r.david.murray, elias, hynek, thehesiod, justin.myers
2018-08-16 22:22:20giampaolo.rodolasetmessageid: <1534458140.39.0.56676864532.issue20849@psf.upfronthosting.co.za>
2018-08-16 22:22:20giampaolo.rodolalinkissue20849 messages
2018-08-16 22:22:20giampaolo.rodolacreate