Skip to content

gh-105689: Parse only the current statement in the IDLE Shell - #157594

Open
serhiy-storchaka wants to merge 1 commit into
python:mainfrom
serhiy-storchaka:gh-105689-shell-hyperparser
Open

serhiy-storchaka wants to merge 1 commit into
python:mainfrom
serhiy-storchaka:gh-105689-shell-hyperparser

Conversation

@serhiy-storchaka

@serhiy-storchaka serhiy-storchaka commented Sep 15, 2026

Copy link
Copy Markdown
Member

Since the prompts moved to the sidebar in 3.10, sys.ps1 ends with a newline and prompt_last_line is empty, so HyperParser and newline_and_indent_event took the editor path in the Shell and scanned back through previous output. Unbalanced quotes or parentheses in that output — a traceback for raise ValueError("""\n"""), a SyntaxError: '(' was never closed — then broke calltips, parenthesis matching and auto-indent for everything typed afterwards. Use an explicit is_shell attribute and parse only the current statement in the Shell, as before 3.10. This also fixes the Shell examples of #124451.

🤖 Generated with Claude Code

Since the prompts moved to the sidebar, sys.ps1 ends with a newline
and prompt_last_line is empty, so HyperParser and newline_and_indent
took the editor path in the Shell and parsed previous output. Use an
explicit is_shell attribute instead.

Co-Authored-By: Claude Opus 5 (1M context) <[email protected]>
@serhiy-storchaka serhiy-storchaka added needs backport to 3.13 bugs and security fixes needs backport to 3.14 bugs and security fixes needs backport to 3.15 pre-release feature fixes, bugs and security fixes labels Sep 15, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

awaiting core review needs backport to 3.13 bugs and security fixes needs backport to 3.14 bugs and security fixes needs backport to 3.15 pre-release feature fixes, bugs and security fixes

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant