[issue1577] shutil.move() does not use os.rename() if dst is a directory

Raghuram Devarakonda report at bugs.python.org
Tue Jan 29 21:53:22 CET 2008


Raghuram Devarakonda added the comment:

We are back to square 1 :-). Your patch incorporates Facundo's
suggestion which is 'rename(src_file, dst_dir/`basename src_file`). It
is not clear to me from rereading the earlier comments whether Guido
rejected this approach or not. I would personally prefer this approach.
If this change is not going to be considered, we will be left with
making a doc change; something to the effect:

"If the destination is a file and is on same file system as that of
src, then simply use rename."

An additional doc change will be needed to correct the statement "If dst
is a directory, OSError will be raised". As you found out, this is not
entirely true on Linux and perhaps on other versions of unix. 

I don't think any other changes are needed. I did not go through the
test cases in the patch but I think we can certainly use some of them
even if no code change is done.

__________________________________
Tracker <report at bugs.python.org>
<http://bugs.python.org/issue1577>
__________________________________


More information about the Python-bugs-list mailing list