mirror of
https://github.com/python/cpython.git
synced 2025-07-19 01:05:26 +00:00
GH-104947: Make pathlib.PureWindowsPath comparisons consistent across platforms (GH-104948)
Use `str.lower()` rather than `ntpath.normcase()` to normalize case of Windows paths. This restores behaviour from Python 3.11. Co-authored-by: Gregory P. Smith <greg@krypto.org>
This commit is contained in:
parent
060277d96b
commit
ad0be361c9
3 changed files with 7 additions and 1 deletions
|
@ -421,7 +421,10 @@ class PurePath(os.PathLike):
|
|||
try:
|
||||
return self._str_normcase_cached
|
||||
except AttributeError:
|
||||
self._str_normcase_cached = self._flavour.normcase(str(self))
|
||||
if _is_case_sensitive(self._flavour):
|
||||
self._str_normcase_cached = str(self)
|
||||
else:
|
||||
self._str_normcase_cached = str(self).lower()
|
||||
return self._str_normcase_cached
|
||||
|
||||
@property
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue