This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

classification
Title: PurePath.match indicates case-sensitive nature and presents a case-insensitive example
Type: behavior Stage: resolved
Components: Documentation Versions: Python 3.9, Python 3.8, Python 3.7
process
Status: closed Resolution: fixed
Dependencies: Superseder:
Assigned To: docs@python Nosy List: docs@python, miss-islington, pitrou, serhiy.storchaka, timlo, xtreak
Priority: normal Keywords: patch

Created on 2020-01-10 10:06 by xtreak, last changed 2022-04-11 14:59 by admin. This issue is now closed.

Pull Requests
URL Status Linked Edit
PR 19458 merged timlo, 2020-04-10 14:40
PR 19597 merged miss-islington, 2020-04-19 09:43
PR 19598 merged miss-islington, 2020-04-19 09:43
Messages (4)
msg359717 - (view) Author: Karthikeyan Singaravelan (xtreak) * (Python committer) Date: 2020-01-10 10:06
https://docs.python.org/3/library/pathlib.html#pathlib.PurePath.match

Under PurePath.match there is a statement that case-sensitivity is followed but presents an example in Windows where case insensitive match returns True. This is confusing since match internally uses fnmatch.fnmatchcase that doesn't normalize case but in Windows files are case insensitive. Either the doc could be clarified that it's platform dependent or present a PosixPath example or present two examples with one for Linux and one for Windows that it's platform dependent.

As with other methods, case-sensitivity is observed:

>>> PureWindowsPath('b.py').match('*.PY')
True
msg366772 - (view) Author: miss-islington (miss-islington) Date: 2020-04-19 09:43
New changeset c12375aa0b838d34067efa3f1b9a1fbc632d0413 by Tim Lo in branch 'master':
bpo-39285: Clarify example for PurePath.match (GH-19458)
https://github.com/python/cpython/commit/c12375aa0b838d34067efa3f1b9a1fbc632d0413
msg366774 - (view) Author: miss-islington (miss-islington) Date: 2020-04-19 10:03
New changeset 8c0734397603d84e3a2e753463b44cf904147cc4 by Miss Islington (bot) in branch '3.8':
bpo-39285: Clarify example for PurePath.match (GH-19458)
https://github.com/python/cpython/commit/8c0734397603d84e3a2e753463b44cf904147cc4
msg366775 - (view) Author: miss-islington (miss-islington) Date: 2020-04-19 10:03
New changeset 143147d94f3e55a929327ddae1d0d3c260d71cef by Miss Islington (bot) in branch '3.7':
bpo-39285: Clarify example for PurePath.match (GH-19458)
https://github.com/python/cpython/commit/143147d94f3e55a929327ddae1d0d3c260d71cef
History
Date User Action Args
2022-04-11 14:59:25adminsetgithub: 83466
2020-04-19 10:04:10pitrousetstatus: open -> closed
resolution: fixed
stage: patch review -> resolved
2020-04-19 10:03:45miss-islingtonsetmessages: + msg366775
2020-04-19 10:03:39miss-islingtonsetmessages: + msg366774
2020-04-19 09:43:43miss-islingtonsetpull_requests: + pull_request18934
2020-04-19 09:43:36miss-islingtonsetpull_requests: + pull_request18933
2020-04-19 09:43:14miss-islingtonsetnosy: + miss-islington
messages: + msg366772
2020-04-10 14:40:37timlosetkeywords: + patch
nosy: + timlo

pull_requests: + pull_request18814
stage: patch review
2020-01-10 10:06:56xtreakcreate