[issue6547] shutil.copytree fails on dangling symlinks

2010-04-20 Thread Timothee Besset
Timothee Besset added the comment: My pleasure! We do use a lot of python. -- ___ Python tracker ___ ___ Python-bugs-list mailing list

[issue6547] shutil.copytree fails on dangling symlinks

2010-04-20 Thread Tarek Ziadé
Tarek Ziadé added the comment: Thanks for your work on Quake btw ;) -- ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubs

[issue6547] shutil.copytree fails on dangling symlinks

2010-04-20 Thread Timothee Besset
Timothee Besset added the comment: Good stuff. Didn't occur to me that the operation could have successfully completed before raising the exception -- ___ Python tracker ___ ___

[issue6547] shutil.copytree fails on dangling symlinks

2010-04-20 Thread Tarek Ziadé
Tarek Ziadé added the comment: Added in r80244. This new option willl be available in the next 3.2 release. Until 3.2 is released, what you can do is catch the errors and re-raise the ones that are not due to dangling symlinks: (not tested) >>> from shutil import copytree, Error >>> try: ...

[issue6547] shutil.copytree fails on dangling symlinks

2010-04-20 Thread Tarek Ziadé
Tarek Ziadé added the comment: Please ignore my last message. I've written a test for your error, and it turns out that the error is caught and just raised at the end of the process, meaning that everything else was copied before you get the exception. So shutil.copytree didn't fail. Now, t

[issue6547] shutil.copytree fails on dangling symlinks

2010-04-20 Thread Tarek Ziadé
Changes by Tarek Ziadé : -- ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/optio

[issue6547] shutil.copytree fails on dangling symlinks

2010-04-20 Thread Tarek Ziadé
Tarek Ziadé added the comment: So, here's what I am planing to do after a little thought: When a dangling symlink occurs and symlinks=false, copytree() will just emit a warning, unless the onerror option (new option) is set to a callable. In that case it will receive the src/dst values, and i

[issue6547] shutil.copytree fails on dangling symlinks

2010-04-19 Thread Tarek Ziadé
Tarek Ziadé added the comment: > Ideally I feel it should create the same symlink pointing to a > possibly missing file, since that's what '/bin/cp' does, > and shutil.copytree is broadly understood as a drop in replacement.. That's what would happen if the symlink option is set to True. When

[issue6547] shutil.copytree fails on dangling symlinks

2010-04-19 Thread Timothee Besset
Timothee Besset added the comment: I am not sure what shutil does with symlinks already. At the very least it should not abort the operation. Ideally I feel it should create the same symlink pointing to a possibly missing file, since that's what '/bin/cp' does, and shutil.copytree is broadly

[issue6547] shutil.copytree fails on dangling symlinks

2010-04-19 Thread Tarek Ziadé
Tarek Ziadé added the comment: ok. what behavior would you expect in that case ? I propose that copytree() ignores symlinks that are not linked to an existing file in the copy process, and display a warning in this case. We could add an option to transform this warning into an error that wou

[issue6547] shutil.copytree fails on dangling symlinks

2010-04-19 Thread Timothee Besset
Timothee Besset added the comment: It's a symlink that points to a file that doesn't exist. There are many ways this can happen, in this particular case my text editor (emacs) seems to keep some metadata about which user, machine and process is editing a file. I tried to reproduce in 2.6 (Deb

[issue6547] shutil.copytree fails on dangling symlinks

2010-04-19 Thread Tarek Ziadé
Tarek Ziadé added the comment: Sorry, what's a "dangling symlink" ? can you provide steps to reproduce this ? I am moving the Python version to 2.6. If we are unable to reproduce it for Python > 2.5 we'll close it since we don't fix bugs for 2.5 anymore -- assignee: -> tarek nosy: +

[issue6547] shutil.copytree fails on dangling symlinks

2009-07-22 Thread Timothee Besset
New submission from Timothee Besset : shutil.copytree fails if there is a dangling symlink and symlink is set to False (which is the default). It will raise an exception when trying to get to the content of the symlink. Tested on Debian Etch amd64, python 2.5.2 File "/usr/lib/python2.5/shutil