Message173285
This is somewhat of a nitpick. os.rename's documentation says "If dst is a directory, OSError will be raised". On Unix, this isn't completely true. If the source is a directory and the destination is an empty directory, it'll overwrite the former with the latter. (Actually if the source is a directory the inverse is true; if dst is a file, OSError will be raised.)
In [1]: import os
In [2]: os.mkdir("aaa")
In [3]: open("aaa/blah", "w").close()
In [4]: os.mkdir("bbb")
In [5]: os.rename("aaa", "bbb")
In [6]: os.listdir("bbb")
Out[6]: ['blah'] |
|
Date |
User |
Action |
Args |
2012-10-18 17:36:16 | David.Benjamin | set | recipients:
+ David.Benjamin, docs@python |
2012-10-18 17:36:16 | David.Benjamin | set | messageid: <1350581776.08.0.668682100781.issue16278@psf.upfronthosting.co.za> |
2012-10-18 17:36:16 | David.Benjamin | link | issue16278 messages |
2012-10-18 17:36:15 | David.Benjamin | create | |
|