[issue20849] add exist_ok to shutil.copytree

Alexander Mohr report at bugs.python.org
Sat Mar 15 10:01:29 CET 2014


Alexander Mohr added the comment:

Ya. The original request I think is ok because by allowing that flag it
will replace files and dirs.
On Mar 14, 2014 7:15 PM, "R. David Murray" <report at bugs.python.org> wrote:

>
> R. David Murray added the comment:
>
> I don't know what "the method already allows for existing files" means.
>  Since the target directory can't exist, there can be no existing files.
>
> In unix, this kind of capability is provided by a combination of shell
> globbing and 'cp -r', and by default it does replace existing files.  So it
> would be reasonable for exists_ok to mean exactly that: replace anything
> that currently exists, if it does.
>
> I think that would be a reasonable API, but the implementation isn't as
> simple as just passing through the exists_ok flag to makedirs.
>
> I do not think that *just* making it OK for the destination directory to
> exist would be a good API.
>
> ----------
>
> _______________________________________
> Python tracker <report at bugs.python.org>
> <http://bugs.python.org/issue20849>
> _______________________________________
>

----------

_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue20849>
_______________________________________


More information about the Python-bugs-list mailing list