Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

pathlib.PureWindowsPath comparison results vary between Windows and Posix #104947

Closed
Labels
3.12only security fixes3.13bugs and security fixestopic-pathlibtype-bugAn unexpected behavior, bug, or error
@barneygale

Description

@barneygale

In#31691 I switchedpathlib.PureWindowsPath comparisons to useos.path.normcase() rather thanstr.lower(). This is probably a mistake, as@eryksunpoints out:

The inconsistency is withntpath.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 usingPureWindowsPath on 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().

Linked PRs

Metadata

Metadata

Assignees

No one assigned

    Labels

    3.12only security fixes3.13bugs and security fixestopic-pathlibtype-bugAn unexpected behavior, bug, or error

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions


      [8]ページ先頭

      ©2009-2025 Movatter.jp