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

Raghuram Devarakonda report at bugs.python.org
Wed Jan 23 16:17:10 CET 2008


Raghuram Devarakonda added the comment:

> Before tackling this, I'd like a precision on os.rename(src, dst)
> semantics. The documentation says "If dst is a directory, OSError will
> be raised". However, under Linux, if src is a directory and dst is an
> empty directory, dst is overwritten with src:

I think the doc is incorrect. The rename() man page doesn't explicitly
say that destination can not be directory. In fact, a small C program
directly calling rename() (on SuSE 10) behaves exactly as your python
script.

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


More information about the Python-bugs-list mailing list