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

fnmatch.translate changed in an undocumented way in Python 3.14 #140922

Open
Labels
docsDocumentation in the Doc dir
@Avasam

Description

@Avasam

Documentation

Since Python 3.14,fnmatch.translate appends a lowercasez, whilst 3.13 and below used an uppercaseZ.
https://docs.python.org/3/library/fnmatch.html#fnmatch.translate makes no mention of this. Searching forfnmatch inhttps://docs.python.org/3/whatsnew/3.14.html only findshttps://docs.python.org/3/whatsnew/3.14.html#fnmatch .

> uvx --python=3.13 python -c "import fnmatch; print(fnmatch.translate('foo*'))"(?s:foo.*)\Z> uvx --python=3.14 python -c "import fnmatch; print(fnmatch.translate('foo*'))"(?s:foo.*)\z

(noticed inpypa/distutils#381)


Edit:
After further research, the only mention I could find in "What's new in Python 3.14" ishttps://docs.python.org/3/whatsnew/3.14.html#re, which only says

Support\z as a synonym for\Z

not that\z is now also used in place of\Z.
https://docs.python.org/3/howto/regex.html#more-metacharacters does mention that

\Z
The same as\z. For compatibility with old Python versions.

Up to you to see if this is worth acting upon. It did confuse me and I had a bit of a hard time finding reference for this change. But I understand if it's considered "implementation detail" and that distutils (setuptools)'s test validating a regex is too niche of a use-case to be worth documenting.

Linked PRs

Metadata

Metadata

Assignees

No one assigned

    Labels

    docsDocumentation in the Doc dir

    Projects

    Status

    No status

    Status

    Todo

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions


      [8]ページ先頭

      ©2009-2026 Movatter.jp