FazBrowse GitHub Viewer | Trending |
URL:
| Home
Tools: [Download Repo ZIP]   [Original HTTPS Page]

[3.15] gh-155525: Fix quadratic f-string tokenization (GH-156756) by miss-islington · Pull Request #157828 · python/cpython · GitHub

Repository navigation

[3.15] gh-155525: Fix quadratic f-string tokenization (GH-156756) - #157828

Merged
pablogsal merged 3 commits into
python:3.15from
miss-islington:backport-c1df684-3.15
Sep 19, 2026
Merged

pablogsal merged 3 commits into
python:3.15from
miss-islington:backport-c1df684-3.15

Conversation

miss-islington commented Sep 19, 2026 •
edited by bedevere-app Bot
Loading

Copy link
Copy Markdown
Contributor

Backport gh-156756 to Python 3.15. Retain replacement expressions in the tokenizer buffer instead of repeatedly copying the remaining source. Preserve the expression pointers when the buffer grows, and keep the interactive buffer while a formatted string is open.

Main already received the implementation through gh-156484, so the automatic cherry-pick only brought over tests. This backport also adapts the original fix to the release tokenizer and adds coverage for multiline interactive expressions, which otherwise abort in a debug build.

The targeted parser and command-line tests pass in a debug build, including the CPU-resource tests.

(cherry picked from commit c1df684)

pablogsal and others added 2 commits September 19, 2026 22:37
Adapt the original expression-span fix to the release tokenizer and retain interactive buffers while a formatted string is open.

Co-authored-by: gwosti <322952417+gwosti@users.noreply.github.com>
…thonGH-156756)

* pythongh-155525: Avoid quadratic f-string tokenization

* fixup! pythongh-155525: Avoid quadratic f-string tokenization

---------
(cherry picked from commit c1df684)

Co-authored-by: gwosti <322952417+gwosti@users.noreply.github.com>
Co-authored-by: Pablo Galindo Salgado <Pablogsal@gmail.com>
pablogsal self-requested a review as a code owner September 19, 2026 22:06
pablogsal changed the title [3.15] gh-155525: Cover quadratic f-string tokenization regression (GH-156756) [3.15] gh-155525: Fix quadratic f-string tokenization (GH-156756) Sep 19, 2026

pablogsal left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

The release tokenizer fix and interactive buffer retention are included. The final tree matches the debug build tested locally: 702 tests passed, including the CPU-resource cases and the new interactive regression.

pablogsal enabled auto-merge (squash) September 19, 2026 22:07
pablogsal merged commit b5cbbb2 into python:3.15 Sep 19, 2026
61 of 62 checks passed
miss-islington deleted the backport-c1df684-3.15 branch September 19, 2026 22:37
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

tests Tests in the Lib/test dir

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants


Back | FazBrowse Home | New Git URL