Skip to content

Fix runscript leaving its debugger registered after it returns - #766

Merged
inducer merged 1 commit into
inducer:mainfrom
Vineet829:runscript-release-debugger
Nov 23, 2026
Merged

inducer merged 1 commit into
inducer:mainfrom
Vineet829:runscript-release-debugger

Conversation

@Vineet829

Copy link
Copy Markdown
Contributor

Since #656 (2024.1.2), runscript() called dbg.__del__() in its finally, which unregisters the debugger and closes the PUDB_TTY file. "Placate ruff 0.16.5" (d08939c, in 2026.1) turned that into del dbg, which only drops the local name: the debugger stays in Debugger._current_debugger, and the next runscript() in the process reuses it (%pudb calls it each time). I ran a script that raised, quit, then ran a clean script: it opened in [POST-MORTEM MODE] and n answered "Post-mortem mode: Can't modify state." With PUDB_TTY set, the terminal file also stayed open after runscript() returned. This restores the call with a ruff suppression and adds a test to pudb/test/test_run.py.

@inducer
inducer force-pushed the runscript-release-debugger branch from 1984e24 to b0f3ad6 Compare November 23, 2026 19:18
@inducer
inducer force-pushed the runscript-release-debugger branch from b0f3ad6 to 212fffb Compare November 23, 2026 19:23
@inducer
inducer enabled auto-merge (rebase) November 23, 2026 19:23
@inducer

inducer commented Nov 23, 2026

Copy link
Copy Markdown
Owner

Thanks! I made a new close to replay the (odd-looking) direct call to __del__.

@inducer
inducer merged commit 863f319 into inducer:main Nov 23, 2026
7 checks passed
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