Skip to content

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

Merged
warsaw merged 3 commits into
python:3.13from
warsaw:backport-4572903-3.13
Jul 9, 2026
Merged

[3.13] gh-153056: Backport the relevant bits of (#153057)#153369
warsaw merged 3 commits 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)
@warsaw warsaw self-assigned this Jul 8, 2026
@StanFromIreland StanFromIreland changed the title gh-153056: Backport the relevant bits of (#153057) [3.13] gh-153056: Backport the relevant bits of (#153057) Jul 9, 2026
@read-the-docs-community

read-the-docs-community Bot commented Jul 9, 2026

Copy link
Copy Markdown

@warsaw warsaw enabled auto-merge (squash) July 9, 2026 15:27
@warsaw warsaw merged commit 7994b41 into python:3.13 Jul 9, 2026
41 checks passed
@warsaw warsaw deleted the backport-4572903-3.13 branch July 9, 2026 19:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants