Bug report
Bug description:
Hi,
I am testing the concurrent.interpreters feature from Python 3.14rc3 (the latest current rc).
The subinterpreter seems to behave in a surprising way when encountering syntax errors. For example, in the following code:
from concurrent import interpreters
interpr = interpreters.create()
def exec_catching_errors(code: str) -> None:
try:
interpr.exec(code)
except interpreters.ExecutionFailed as e:
print(f"There was an error: {e}")
print("The function ends")
exec_catching_errors("print(1/0)")
exec_catching_errors("print 1") # this is the surprising line
# the whole script dies with an uncaught SyntaxError
- trying to execute
print(1/0) causes an interpreters.ExecutionFailed that correctly wraps a ZeroDivisionError.
- trying to execute
print 1 causes a bare SyntaxError, whereas I would have expected a subclass of interpreters.InterpreterError wrapping the SyntaxError.
Is this intended behaviour, a bug, or something that simply needs to be better documented?
Thanks
CPython versions tested on:
3.14
Operating systems tested on:
Linux
Bug report
Bug description:
Hi,
I am testing the concurrent.interpreters feature from Python 3.14rc3 (the latest current rc).
The subinterpreter seems to behave in a surprising way when encountering syntax errors. For example, in the following code:
print(1/0)causes aninterpreters.ExecutionFailedthat correctly wraps aZeroDivisionError.print 1causes a bareSyntaxError, whereas I would have expected a subclass ofinterpreters.InterpreterErrorwrapping theSyntaxError.Is this intended behaviour, a bug, or something that simply needs to be better documented?
Thanks
CPython versions tested on:
3.14
Operating systems tested on:
Linux