-
Notifications
You must be signed in to change notification settings - Fork 40
Open
Description
BUG/PROBLEM REPORT / FEATURE REQUEST
Description:
In a restricted Python package environment, the following code snippet:
python 3.10.0
try:
exec("import os; os.system('ls'); print('**')")
except:
pass
successfully executes without throwing an error, despite exec being expected to be undefined in such a restricted environment.
However, when the code is run without the try-except block:
exec("import os; os.system('ls'); print('**')")
an error is thrown as expected.
Expected Behavior:
The restricted environment should prevent the execution of exec and throw an error when it is invoked, regardless of the surrounding try-except block.
Metadata
Metadata
Assignees
Labels
No labels