You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
In case it’s not clear to others, the first bit of code is from the shutil.copytree() implementation at Lib/shutil.py:303.
The documentation currently says “The destination directory . . . must not already exist”. Yuriy seems to be proposing to make copytree() use the existing destination directory, and only create it if it does not already exist. Perhaps you might be interested in bpo-20849, which proposes passing the os.makedirs(exist_ok=...) flag through, which would allow this functionality in a backwards-compatible way.
yuriylevchenko commented on Mar 12, 2015
yuriylevchenkomannequin
MannequinAuthor
More actions
Thanks for the clarifications. Yes parameter will be a good solution!
Activity
yuriylevchenko commentedon Mar 11, 2015
We have a code:
names = os.listdir(src)
if ignore is not None:
ignored_names = ignore(src, names)
else:
ignored_names = set()
But if I had created this folder. I have exception.
Maybe add "if"?
vadmium commentedon Mar 11, 2015
In case it’s not clear to others, the first bit of code is from the shutil.copytree() implementation at Lib/shutil.py:303.
The documentation currently says “The destination directory . . . must not already exist”. Yuriy seems to be proposing to make copytree() use the existing destination directory, and only create it if it does not already exist. Perhaps you might be interested in bpo-20849, which proposes passing the os.makedirs(exist_ok=...) flag through, which would allow this functionality in a backwards-compatible way.
yuriylevchenko commentedon Mar 12, 2015
Thanks for the clarifications. Yes parameter will be a good solution!