[issue39285] PurePath.match indicates case-sensitive nature and presents a case-insensitive example
New submission from Karthikeyan Singaravelan <tir.karthi@gmail.com>: 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
---------- assignee: docs@python components: Documentation messages: 359717 nosy: docs@python, pitrou, serhiy.storchaka, xtreak priority: normal severity: normal status: open title: PurePath.match indicates case-sensitive nature and presents a case-insensitive example type: behavior versions: Python 3.7, Python 3.8, Python 3.9 _______________________________________ Python tracker <report@bugs.python.org> <https://bugs.python.org/issue39285> _______________________________________
Change by Tim Lo <timlo604@gmail.com>: ---------- keywords: +patch nosy: +timlo nosy_count: 4.0 -> 5.0 pull_requests: +18814 stage: -> patch review pull_request: https://github.com/python/cpython/pull/19458 _______________________________________ Python tracker <report@bugs.python.org> <https://bugs.python.org/issue39285> _______________________________________
miss-islington <mariatta.wijaya+miss-islington@gmail.com> added the comment: New changeset c12375aa0b838d34067efa3f1b9a1fbc632d0413 by Tim Lo in branch 'master': bpo-39285: Clarify example for PurePath.match (GH-19458) https://github.com/python/cpython/commit/c12375aa0b838d34067efa3f1b9a1fbc632... ---------- nosy: +miss-islington _______________________________________ Python tracker <report@bugs.python.org> <https://bugs.python.org/issue39285> _______________________________________
Change by miss-islington <mariatta.wijaya+miss-islington@gmail.com>: ---------- pull_requests: +18933 pull_request: https://github.com/python/cpython/pull/19597 _______________________________________ Python tracker <report@bugs.python.org> <https://bugs.python.org/issue39285> _______________________________________
Change by miss-islington <mariatta.wijaya+miss-islington@gmail.com>: ---------- pull_requests: +18934 pull_request: https://github.com/python/cpython/pull/19598 _______________________________________ Python tracker <report@bugs.python.org> <https://bugs.python.org/issue39285> _______________________________________
miss-islington <mariatta.wijaya+miss-islington@gmail.com> added the comment: 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/8c0734397603d84e3a2e753463b44cf9041... ---------- _______________________________________ Python tracker <report@bugs.python.org> <https://bugs.python.org/issue39285> _______________________________________
miss-islington <mariatta.wijaya+miss-islington@gmail.com> added the comment: 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/143147d94f3e55a929327ddae1d0d3c260d... ---------- _______________________________________ Python tracker <report@bugs.python.org> <https://bugs.python.org/issue39285> _______________________________________
Change by Antoine Pitrou <solipsis@pitrou.net>: ---------- resolution: -> fixed stage: patch review -> resolved status: open -> closed _______________________________________ Python tracker <report@bugs.python.org> <https://bugs.python.org/issue39285> _______________________________________
participants (4)
-
Antoine Pitrou -
Karthikeyan Singaravelan -
miss-islington -
Tim Lo