FazBrowse GitHub Viewer | Trending |
URL:
| Home
Tools: [Download Repo ZIP]   [Original HTTPS Page]

bpo-28356: Document os.rename() behavior on Windows for differing filesystems by rhyn0 · Pull Request #27376 · python/cpython · GitHub

/ cpython Public
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension .rst  (1) All 1 file type selected
Viewed files
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Unified
Split
Hide whitespace
Diff view
Unified
Split
Hide whitespace
2 changes: 2 additions & 0 deletions Doc/library/os.rst
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
Original file line number Diff line number Diff line change
Expand Up @@ -2292,6 +2292,8 @@ features:
will fail with an :exc:`OSError` subclass in a number of cases:

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

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.


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.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

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
Expand Down

Back | FazBrowse Home | New Git URL