[New-bugs-announce] [issue39285] PurePath.match indicates case-sensitive nature and presents a case-insensitive example

Karthikeyan Singaravelan report at bugs.python.org
Fri Jan 10 05:06:56 EST 2020


New submission from Karthikeyan Singaravelan <tir.karthi at 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 at python
components: Documentation
messages: 359717
nosy: docs at 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 at bugs.python.org>
<https://bugs.python.org/issue39285>
_______________________________________


More information about the New-bugs-announce mailing list