-
-
Notifications
You must be signed in to change notification settings - Fork 32.1k
gh-88569: add ntpath.isreserved()
#95486
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
Merged
Merged
Changes from 4 commits
Commits
Show all changes
38 commits
Select commit
Hold shift + click to select a range
6b89ecc
gh-88569: add `os.path.isreserved()`
barneygale 3e08e4a
Fix tests
barneygale 49ba439
Remove implementation in `genericpath`
barneygale 238b3e3
Apply suggestions from code review
barneygale f647502
Apply suggestions from code review
barneygale f07c7ad
Remove tests for pathlib.PurePath.is_reserved().
barneygale dc857c9
Speed up isreserved('.') and '..'
barneygale f0fd2c8
Note change to algorithm in pathlib docs.
barneygale 3b51db8
Update Lib/ntpath.py
barneygale 06cb428
Update Doc/library/os.path.rst
barneygale 79c0be4
Update Lib/posixpath.py
barneygale 0a0db6a
Restore `os.fspath()` call in `posixpath.isreserved()`
barneygale 7145b86
Apply suggestions from code review
barneygale 9f74b64
posixpath.isreserved(): return True for paths with NUL characters
barneygale 91b2bb3
ntpath.isreserved(): minor tweaks
barneygale e6aff58
ntpath.isreserved(): restore initial splitdrive() call
barneygale e6a2c0b
ntpath.isreserved(): avoid calling `splitdrive()` repeatedly.
barneygale 14dde15
Update Lib/ntpath.py
barneygale fab274a
Add `isreservedname()` for discussion.
barneygale 936dcc8
Apply suggestions from code review
barneygale 3fb127f
Undo posixpath changes
barneygale 002d951
Merge branch 'main' into os-path-isreserved
barneygale c8ed711
Update version numbers.
barneygale c772b25
Fix syntax, whitespace.
barneygale 3fbef57
Make `isreservedname()` private
barneygale 4b34274
Update Lib/ntpath.py
barneygale a877677
Tighten up `PurePath.is_reserved()` exception handling.
barneygale 3721c8c
Use `str(self)` to support non-os.PathLike implementations.
barneygale b905d2f
Deprecate `pathlib.PurePath.is_reserved()`
barneygale 2756ffb
Add note about approximate and changing Windows rules; remove doctest.
barneygale c03c672
Update Doc/library/os.path.rst
barneygale 4085ff5
Update what's new.
barneygale b4b3d0b
Mention deprecation in NEWS
barneygale 9e2d21f
Address review feedback
barneygale 44c37cb
Point to `os.path.isreserved()` in whatsnew deprecation notices.
barneygale f9033b3
Merge branch 'main' into os-path-isreserved
barneygale efb7681
Merge branch 'main' into os-path-isreserved
barneygale e398c3f
Address review feedback
barneygale File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
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
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
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
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
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
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
3 changes: 3 additions & 0 deletions
3
Misc/NEWS.d/next/Library/2022-07-31-01-24-40.gh-issue-88569.eU0--b.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 |
---|---|---|
@@ -0,0 +1,3 @@ | ||
Add :func:`os.path.isreserved`, which identifies reserved pathnames. On | ||
Windows, reserved names include "NUL", "AUX" and "CON". On other platforms, | ||
this function always returns ``False``. |
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.