New submission from Ingemar Nilsson: If you use shutil.move(src, dst) to move a file src to a directory dst, the file will not be renamed into the dst directory, but rather copied-then-removed, even if src and dst is on the same filesystem. There are several ways to fix this:
* (The easiest) Fix the documentation for shutil.move() so that this is mentioned. * Fix shutil.move() so that it rename a file into a new directory. * Change os.rename() to accept a directory as a destination for a file. The reason for this problem is that shutil.move() tries to use os.rename(), but fails since the destination is a directory. It then proceeds to the copy-then-remove method, even though the documentation gives the impression that this only happens when src and dst are on different filesystems. ---------- components: Library (Lib) messages: 58332 nosy: init severity: normal status: open title: shutil.move() does not use os.rename() if dst is a directory type: behavior versions: Python 2.5 __________________________________ Tracker <[EMAIL PROTECTED]> <http://bugs.python.org/issue1577> __________________________________ _______________________________________________ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com