Surface SyntaxError from input transformation instead of crashing the…#293
Surface SyntaxError from input transformation instead of crashing the…#293JimWallace wants to merge 1 commit into
Conversation
… kernel PyodideKernel.run() called transform_cell() outside any try/except, so a SyntaxError raised during input transformation — most commonly TabError on Python 3.12+, which the tokenizer raises eagerly — escaped run() unhandled and surfaced as a raw kernel traceback instead of a normal error cell. Guard the transform like InteractiveShell.run_cell does and route failures through showtraceback() (which dispatches SyntaxError to showsyntaxerror), reusing the existing _last_traceback reporting. https://claude.ai/code/session_017qs8Cz1XgFG4oBPqNPqLom
|
Closes #292 SummaryOn Python 3.12+, a Root cause
FixWrap the two |
… kernel
PyodideKernel.run() called transform_cell() outside any try/except, so a SyntaxError raised during input transformation — most commonly TabError on Python 3.12+, which the tokenizer raises eagerly — escaped run() unhandled and surfaced as a raw kernel traceback instead of a normal error cell.
Guard the transform like InteractiveShell.run_cell does and route failures through showtraceback() (which dispatches SyntaxError to showsyntaxerror), reusing the existing _last_traceback reporting.
https://claude.ai/code/session_017qs8Cz1XgFG4oBPqNPqLom