Uh oh!
There was an error while loading.Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork33.7k
Description
In#31691 I switchedpathlib.PureWindowsPath comparisons to useos.path.normcase() rather thanstr.lower(). This is probably a mistake, as@eryksunpoints out:
The inconsistency is with
ntpath.normcase()on Windows. It's probably for the best if the pure comparison methods revert to usingstr.lower()for the sake of consistency, not only withglob()andmatch(), but also with usingPureWindowsPathon POSIX. Maybe platform-dependent comparisons could be implemented onPath.On Windows,
ntpath.normcase()is based onLCMapStringEx(). It turns out that this function implements a case mapping for some non-BMP characters. WinAPICompareStringOrdinal(), on the other hand, has no case mapping for non-BMP characters, which is consistent with Microsoft's filesystems. Thus I'd prefer for a platform-dependent comparison to useCompareStringOrdinal()instead ofLCMapStringEx().