Message385083
According to https://docs.python.org/3.8/library/shutil.html#shutil.move
"If the destination already exists but is not a directory, it may be overwritten depending on os.rename() semantics."
I interpret "depending on os.rename() semantics" to mean it will follow os.rename()'s behavior.
According to https://docs.python.org/3/library/os.html#os.rename
"On Windows, if dst exists a FileExistsError is always raised."
However, their behaviors are not the same.
For os.rename, it does raise FileExistsError if dst exists.
For shutil.move, it silently overwrites dst.
It's either a bug in behavior of shutil.move, or the documentation need to be updated. |
|
Date |
User |
Action |
Args |
2021-01-14 21:29:10 | fireattack | set | recipients:
+ fireattack |
2021-01-14 21:29:10 | fireattack | set | messageid: <1610659750.09.0.0459892919552.issue42929@roundup.psfhosted.org> |
2021-01-14 21:29:10 | fireattack | link | issue42929 messages |
2021-01-14 21:29:09 | fireattack | create | |
|