Open Pierre-Sassoulas opened 3 weeks ago
Where do you get this error? Locally this example also doesn't run? So perhaps it is just an invalid snippet?
I created it :) If you remove allowed_global
from the exec call, it's going to work as expected (print the nefarious conniving).
Sorry I still don't understand the issue 😅
If I run this code locally without the comment then I also get a crash. So isn't it excepted that you get some kind of (System)Error
when you uncomment it?
Hmm not sure if it's due to mac vs Ubuntu or if there's some kind if misunderstanding. On my side it print when allowed_global is commented and crash when it's not. Maybe you can provide an exemple where print is being called inside an exec when allowed_globals should forbid it ?
But in the old code there is no allowed_global
right? So the new code without the comment is just invalid Python?
Type of Changes
Description
I wanted to make the example's formatting better in details, ended up trying to reproduce it, but it seems the
allow_globals
parameters is smarter than we thought when originally documenting it. I get this error when uncommenting# allowed_globals
:What am I doing wrong @DanielNoord ?