Skip to content

gh-153056: Backport the relevant bits of (#153057)#153369

Open
warsaw wants to merge 1 commit into
python:3.13from
warsaw:backport-4572903-3.13
Open

gh-153056: Backport the relevant bits of (#153057)#153369
warsaw wants to merge 1 commit into
python:3.13from
warsaw:backport-4572903-3.13

Conversation

@warsaw

@warsaw warsaw commented Jul 8, 2026

Copy link
Copy Markdown
Member

The data race for compiling the string.Template pattern in free-threading builds is not relevant for 3.13, due to the older string.Template and string.py module implementation. However, the secondary bug identified by that isue is still relevant here, and fixed in this branch:

As a side effect, a subclass that supplies an already-compiled pattern now works too; previously
it raised the same ValueError at class definition.
  • Document that the pattern attribute accepts a string or a compiled regex
  • Comment the three states of pattern and note the documented-behavior fix in NEWS
  • Update Doc/library/string.rst

(cherry picked from commit 4572903)

The data race for compiling the string.Template pattern in free-threading builds is not relevant for
3.13, due to the older string.Template and string.py module implementation.  However, the secondary
bug identified by that isue is still relevant here, and fixed in this branch:

    As a side effect, a subclass that supplies an already-compiled pattern now works too; previously
    it raised the same ValueError at class definition.

* Document that the pattern attribute accepts a string or a compiled regex
* Comment the three states of pattern and note the documented-behavior fix in NEWS
* Update Doc/library/string.rst

---------

Co-authored-by: Barry Warsaw <barry@python.org>
(cherry picked from commit 4572903)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants