[issue22132] Cannot copy the same directory structure to the same destination more than once

2014-08-07 Thread Csaba Makara

Csaba Makara added the comment:

Sorry for the late answer.
It was a direct usage of the dir_utils.copy_tree.
I absolutely understand you don't want to touch it.

--

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



[issue22132] Cannot copy the same directory structure to the same destination more than once

2014-08-07 Thread Éric Araujo

Éric Araujo added the comment:

Thanks.  There is a function intended for general use: shutil.copytree; it may 
have the same behavior (not a bug if it's documented).

--
resolution:  - wont fix
stage:  - resolved
status: open - closed

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



[issue22132] Cannot copy the same directory structure to the same destination more than once

2014-08-04 Thread Csaba Makara

New submission from Csaba Makara:

If I use the distutils.dir_util.copy_tree to copy the same directory structure 
multiple times to the same place (even from multiple sources) but I remove and 
recreate the target_directory before each copy, the following exception accurs:

g:\_Programmingpy example.py
Traceback (most recent call last):
  File E:\Python34\lib\distutils\file_util.py, line 41, in _copy_file_contents

fdst = open(dst, 'wb')
FileNotFoundError: [Errno 2] No such file or directory: 'c:\\bin\\folder_inside\
\file_inside.txt'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File example.py, line 13, in module
dir_util.copy_tree(source_folder2, target_folder)
  File E:\Python34\lib\distutils\dir_util.py, line 160, in copy_tree
verbose=verbose, dry_run=dry_run))
  File E:\Python34\lib\distutils\dir_util.py, line 164, in copy_tree
dry_run=dry_run)
  File E:\Python34\lib\distutils\file_util.py, line 143, in copy_file
_copy_file_contents(src, dst)
  File E:\Python34\lib\distutils\file_util.py, line 44, in _copy_file_contents

could not create '%s': %s % (dst, e.strerror))
distutils.errors.DistutilsFileError: could not create 'c:\bin\folder_inside\file
_inside.txt': No such file or directory
___

If the target_folder is not deleted, the problem won't appear. 
The problem seems to be the handling of the inner directories. In the second 
attempt the inner folders are thought to be existing, but they are not.

See the attached script.

--
components: Distutils
files: example.py
messages: 224691
nosy: Csaba.Makara, dstufft, eric.araujo
priority: normal
severity: normal
status: open
title: Cannot copy the same directory structure to the same destination more 
than once
type: crash
versions: Python 3.4
Added file: http://bugs.python.org/file36244/example.py

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



[issue22132] Cannot copy the same directory structure to the same destination more than once

2014-08-04 Thread Éric Araujo

Éric Araujo added the comment:

Thanks for the report.  Did you find this issue with a setup.py file or with 
direct usage of dir_utils.copy_tree?  These distutils modules are not meant for 
general use, so bugs that don’t occur during regular use of setup.py files will 
probably not get fixed.  (Distutils has fragile internals so it’s policy to do 
as little change as possible to avoid breaking other things.)

--

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