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 fireattack
Recipients fireattack
Date 2021-01-14.21:29:09
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1610659750.09.0.0459892919552.issue42929@roundup.psfhosted.org>
In-reply-to
Content
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.
History
Date User Action Args
2021-01-14 21:29:10fireattacksetrecipients: + fireattack
2021-01-14 21:29:10fireattacksetmessageid: <1610659750.09.0.0459892919552.issue42929@roundup.psfhosted.org>
2021-01-14 21:29:10fireattacklinkissue42929 messages
2021-01-14 21:29:09fireattackcreate