Uh oh!
There was an error while loading. Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork 33.9k
gh-104484: Add parameter @case_sensitive to pathlib.PurePath.match() function#104565
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
Uh oh!
There was an error while loading. Please reload this page.
Merged
Changes from all commits
Commits
Show all changes
11 commits Select commit Hold shift + click to select a range
473eeaf Add parameter @case_sensitive to pathlib.PurePath.match() function
thirumurugan-git 17e721f Add NEWS entry
thirumurugan-git 73907a6 Refactor case sensitive check
thirumurugan-git 8c3f4a4 Handle platform specific case sensitivity and add test cases
thirumurugan-git 1e638fe Code formatting
thirumurugan-git 53e0bb8 Resolve threads
thirumurugan-git 90ed5c6 Update Doc/whatsnew/3.12.rst
thirumurugan-git 563172c Update Misc/NEWS.d/next/Library/2023-05-17-03-14-07.gh-issue-104484.y…
thirumurugan-git be06795 Update Lib/pathlib.py
thirumurugan-git 466abc2 Update document
thirumurugan-git afee333 Update pathlib.py
thirumurugan-git File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Uh oh!
There was an error while loading. Please reload this page.
Jump to
Jump to file
Failed to load files.
Loading
Uh oh!
There was an error while loading. Please reload this page.
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -312,6 +312,11 @@ def test_match_common(self): | ||
| # Multi-part glob-style pattern. | ||
| self.assertFalse(P('/a/b/c.py').match('/**/*.py')) | ||
| self.assertTrue(P('/a/b/c.py').match('/a/**/*.py')) | ||
| # Case-sensitive flag | ||
| self.assertFalse(P('A.py').match('a.PY', case_sensitive=True)) | ||
| self.assertTrue(P('A.py').match('a.PY', case_sensitive=False)) | ||
| self.assertFalse(P('c:/a/B.Py').match('C:/A/*.pY', case_sensitive=True)) | ||
| self.assertTrue(P('/a/b/c.py').match('/A/*/*.Py', case_sensitive=False)) | ||
thirumurugan-git marked this conversation as resolved. Show resolvedHide resolvedUh oh!There was an error while loading. Please reload this page. | ||
| def test_ordering_common(self): | ||
| # Ordering is tuple-alike. | ||
| @@ -916,7 +921,7 @@ def test_as_uri(self): | ||
| self.assertEqual(P('//some/share/a/b%#c\xe9').as_uri(), | ||
| 'file://some/share/a/b%25%23c%C3%A9') | ||
| def test_match_common(self): | ||
| def test_match(self): | ||
| P = self.cls | ||
| # Absolute patterns. | ||
| self.assertTrue(P('c:/b.py').match('*:/*.py')) | ||
1 change: 1 addition & 0 deletions 1 Misc/NEWS.d/next/Library/2023-05-17-03-14-07.gh-issue-104484.y6KxL6.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 @@ | ||
| Added *case_sensitive* argument to :meth:`pathlib.PurePath.match` |
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.