Skip to content

Conversation

miss-islington
Copy link
Contributor

@miss-islington miss-islington commented May 25, 2025

Fix an UnboundLocalError that can occur when parsing certain delimited constructs in headers (domain literals, quoted strings, comments). After the fix the _get_ptext_to_endchars returns an empty string if there is no content after the opening delimiter. The calling code is responsible for handling the lack of the trailing delimiter, which it already does; this edge case was the header ending immediately after the opening delimiter.
(cherry picked from commit a32ea45)

Co-authored-by: R. David Murray rdmurray@bitdance.com

…_get_ptext_to_endchars (pythonGH-134233)

Fix an UnboundLocalError that can occur when parsing certain delimited constructs in headers (domain literals, quoted strings, comments). After the fix the _get_ptext_to_endchars returns an empty string if there is no content after the opening delimiter. The calling code is responsible for handling the lack of the trailing delimiter, which it already does; this edge case was the header ending immediately after the opening delimiter.
(cherry picked from commit a32ea45)

Co-authored-by: R. David Murray <rdmurray@bitdance.com>
@miss-islington miss-islington requested a review from a team as a code owner May 25, 2025 22:10
@hugovk hugovk merged commit 1ce68f6 into python:3.14 May 26, 2025
43 checks passed
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.

3 participants