[Python-bugs-list] [ python-Bugs-490168 ] shutil.copy(path, path) deletes contents

noreply@sourceforge.net noreply@sourceforge.net
Mon, 10 Dec 2001 02:42:42 -0800


Bugs item #490168, was opened at 2001-12-07 01:16
You can respond by visiting: 
http://sourceforge.net/tracker/?func=detail&atid=105470&aid=490168&group_id=5470

Category: Python Library
Group: Python 2.1.1
Status: Open
Resolution: None
Priority: 5
Submitted By: Nobody/Anonymous (nobody)
Assigned to: Nobody/Anonymous (nobody)
Summary: shutil.copy(path, path) deletes contents

Initial Comment:
If source equals destination path the contents of the 
file is deleted.

----------------------------------------------------------------------

>Comment By: Michael Hudson (mwh)
Date: 2001-12-10 02:42

Message:
Logged In: YES 
user_id=6656

To the OP, if you're paying attention: shutil is pretty
useless.  You might consider using distutils.file_util
instead (though I don't know if that suffers from this
"problem").

I wanted to do somthing about this before 2.2, sigh...

----------------------------------------------------------------------

Comment By: Guido van Rossum (gvanrossum)
Date: 2001-12-08 09:17

Message:
Logged In: YES 
user_id=6380

I know the Unix 'cp' command tests for this condition, but
shouldn't this fall in the category of "don't do that, then"
in the Python world? How stupid do we expect the programmer
to be?

----------------------------------------------------------------------

You can respond by visiting: 
http://sourceforge.net/tracker/?func=detail&atid=105470&aid=490168&group_id=5470