[issue23638] shutil.copytree makedirs exception

2015-03-12 Thread R. David Murray

Changes by R. David Murray rdmur...@bitdance.com:


--
resolution:  - duplicate
stage:  - resolved
status: open - closed
superseder:  - add exist_ok to shutil.copytree

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue23638
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue23638] shutil.copytree makedirs exception

2015-03-12 Thread yuriy_levchenko

yuriy_levchenko added the comment:

Thanks for the clarifications. Yes parameter will be a good solution!

--

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue23638
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue23638] shutil.copytree makedirs exception

2015-03-12 Thread yuriy_levchenko

Changes by yuriy_levchenko levchenko.yuriy.vladimirov...@gmail.com:


--
type:  - behavior

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue23638
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue23638] shutil.copytree makedirs exception

2015-03-11 Thread Martin Panter

Martin Panter added the comment:

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 Issue 20849, which proposes passing the 
os.makedirs(exist_ok=...) flag through, which would allow this functionality in 
a backwards-compatible way.

--
nosy: +vadmium

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue23638
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue23638] shutil.copytree makedirs exception

2015-03-11 Thread yuriy_levchenko

New submission from yuriy_levchenko:

We have a code:
names = os.listdir(src)
if ignore is not None:
ignored_names = ignore(src, names)
else:
ignored_names = set()

os.makedirs(dst)

errors = []

But if I had created this folder. I have exception.

Maybe add if?

if os.path.isdir(dst) is False:
os.makedirs(dst)
pass

--
components: Library (Lib)
messages: 237858
nosy: yuriy_levchenko
priority: normal
severity: normal
status: open
title: shutil.copytree makedirs exception
versions: Python 3.4

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue23638
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com