-
-
Notifications
You must be signed in to change notification settings - Fork 32.4k
gh-68320, gh-88302 - Allow for pathlib.Path
subclassing
#31691
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
brettcannon
merged 53 commits into
python:main
from
barneygale:bpo-44136-remove-pathlib-flavour-2
Dec 23, 2022
Merged
Changes from 1 commit
Commits
Show all changes
53 commits
Select commit
Hold shift + click to select a range
7371220
bpo-24132, bpo-44136 - Fix `pathlib.Path` subclassing.
barneygale 8431d12
Add tests
barneygale bf2ad3a
Add tests for PurePath subclasses
barneygale 4036e2e
Update Misc/NEWS.d/next/Library/2022-03-05-02-14-09.bpo-24132.W6iORO.rst
barneygale 0d08533
Rename `PurePath._pathmod` to `PurePath._flavour` to reduce the diff.
barneygale 0ad8022
Merge branch 'bpo-44136-remove-pathlib-flavour-2' of github.com:barne…
barneygale 28992fc
Undo an unnecessary change to `Path.__new__()`
barneygale dbec230
Remove `_casefold()` and `_casefold_parts()` methods.
barneygale d814ee4
Merge branch 'main' into bpo-44136-remove-pathlib-flavour-2
barneygale 63f1d68
Further simplify overall diff by inlining code from `compile_pattern()`
barneygale 8dddfdf
Apply suggestions from code review
barneygale b4da721
Address a couple bits of review feedback
barneygale 7a166fd
Fix tests
barneygale 1f4dff1
Fix docstring formatting.
barneygale 51893c1
Remove FIXME comments
barneygale 48b49b6
Merge branch 'main' into bpo-44136-remove-pathlib-flavour-2
barneygale 3624c97
Update Lib/pathlib.py
barneygale ab54c14
Remove vestigal 'casefold' names.
barneygale 2627417
Merge branch 'main' into bpo-44136-remove-pathlib-flavour-2
barneygale
8000
bc7aded
Restore comment on POSIX paths beginning `//` and tweak implementation.
barneygale 4d6e4f3
Inline `_join_parsed_parts()` and `_make_child()` in `joinpath()`.
barneygale 70ca838
Update Lib/pathlib.py
barneygale a2cc74f
Remove unused import
barneygale 0e2478b
Make NEWS entry more precise.
barneygale 0d0cf60
Apply suggestions from code review
barneygale f3048d3
Clarify `_pparts` and `_ncparts` naming.
barneygale 8a213ae
Tidy up usage of `normcase()`
barneygale 402dafe
Tweak `is_absolute()` to use `os.path.isabs()` wherever possible.
barneygale 5cc3ab2
Stop using `self._flavour` in `as_uri()`.
barneygale 19a8804
Remove `cls._flavour` identity check in `_parse_parts()`.
barneygale 9da46bc
Fix Windows tests
barneygale 29f9f81
Restore `_split_root()` method and its tests.
barneygale 52851b8
Merge branch 'main' into bpo-44136-remove-pathlib-flavour-2
barneygale b39da53
Optimize `_split_root()`
barneygale c7b18b1
Merge branch 'main' into bpo-44136-remove-pathlib-flavour-2
barneygale 806ad15
Move `is_reserved()` implementation into `os.path` as a private funct…
barneygale a350009
Use `os.path.normcase()` when globbing.
barneygale 799b40e
Simplify `_split_root()` implementation.
barneygale a6b25ea
Remove tests for malformed UNC paths
barneygale ac6f6e2
Merge branch 'main' into bpo-44136-remove-pathlib-flavour-2
brettcannon b8874df
Revert "Move `is_reserved()` implementation into `os.path` as a priva…
barneygale 9d5e18a
Tweak _split_root() to use removesuffix()
barneygale f73f426
Remove test that `/b/c/d` and `///b/c/d` are equivalent.
barneygale 37e4bc1
Restore comment linking to *Naming Files* page in Microsoft docs
barneygale e3f13ef
Apply suggestions from code review
barneygale ff4e1b3
Merge branch 'main' into bpo-44136-remove-pathlib-flavour-2
barneygale 07c67d0
Clarify repr roundtrip tests.
barneygale 950aa47
Reduce tests diff
barneygale d5f6f03
Remove test that `/b/c/d` and `///b/c/d` are equivalent.
barneygale b66a4fb
Fix missing full stops.
barneygale fbaadf4
Remove four more test assertions affected by #96290
barneygale 3692fdf
Merge branch 'main' into bpo-44136-remove-pathlib-flavour-2
barneygale 40dc514
Wrap repr test cases in `self.subTest()` block
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
Tweak _split_root() to use removesuffix()
- Loading branch information
commit 9d5e18a3502a8941783dcad0c9f0e4a65ccb68c6
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
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.