This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author pitrou
Recipients draghuram, facundobatista, gvanrossum, init, pitrou
Date 2008-01-23.14:46:24
SpamBayes Score 0.34777293
Marked as misclassified No
Message-id <1201099585.88.0.373241749138.issue1577@psf.upfronthosting.co.za>
In-reply-to
Content
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:

$ mkdir src dst
$ touch dst/t
$ ./python -c "import os; os.rename('src', 'dst')"
Traceback (most recent call last):
  File "<string>", line 1, in <module>
OSError: [Errno 39] Directory not empty
$ rm dst/t
$ ./python -c "import os; os.rename('src', 'dst')"
$ 

Is this a bug, a misfeature, or just an imprecision in the documentation?
History
Date User Action Args
2008-01-23 14:46:26pitrousetspambayes_score: 0.347773 -> 0.34777293
recipients: + pitrou, gvanrossum, facundobatista, draghuram, init
2008-01-23 14:46:25pitrousetspambayes_score: 0.347773 -> 0.347773
messageid: <1201099585.88.0.373241749138.issue1577@psf.upfronthosting.co.za>
2008-01-23 14:46:24pitroulinkissue1577 messages
2008-01-23 14:46:24pitroucreate