-
-
Notifications
You must be signed in to change notification settings - Fork 31.7k
bpo-28356: Document os.rename() behavior on Windows for differing filesystems #27376
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2292,6 +2292,8 @@ features: | |
will fail with an :exc:`OSError` subclass in a number of cases: | ||
|
||
On Windows, if *dst* exists a :exc:`FileExistsError` is always raised. | ||
The operation may fail if *src* and *dst* are on different filesystems. Use | ||
:func:`shutil.move` to support moves to a different filesystem. | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I believe since this statement is Windows-specific, it's fine to keep it under the Windows section despite being slightly unrelated to the general case of dst existing. But let me know if it's preferred to open up a new paragraph above/below (or if removing the sentence on dst exists is preferred). |
||
|
||
On Unix, if *src* is a file and *dst* is a directory or vice-versa, an | ||
:exc:`IsADirectoryError` or a :exc:`NotADirectoryError` will be raised | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think it's better to keep this sentence since explicitly stating that all the related exceptions below are subclasses of
OSError
could be helpful for easily catching the exceptions, but I can remove it nonetheless if wanted here.