-
Notifications
You must be signed in to change notification settings - Fork 52
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
tracebackrepy.py triggers "Unsafe call" error in safe.py #92
Comments
To test @DennisMirante's patch, I modified the Repy runtime function To trigger the "Unsafe call" problem, we need to make Repy use the servicelog: This however only shifts the problem to the next unsafe call, this time it's
|
If you add: "hasattr = hasattr" to the outer scope of the servicelogger, I On Fri, Sep 26, 2014 at 5:52 PM, aaaaalbert [email protected]
|
I ended up adding a couple of things to
I'll experiment some more to see if that's the best place to put these additional stashes. |
This removes two conditional function-level `import`s of `servicelogger.py`. As these could be reached from within a Repy program, and Repy forbids `import`, this caused a misleading error message. (See SeattleTestbed#69 for another similarly-looking problem).
This removes two conditional function-level `import`s of `servicelogger.py`. As these could be reached from within a Repy program, and Repy forbids `import`, this caused a misleading error message. (See SeattleTestbed#69 for another similarly-looking problem).
As a consequence of #69,
safe.py
destroying builtins likeimport
for everything that runs after it (including other Python code of the Repy runtime!),tracebackrepy.py
triggers an error when trying to log an "Internal Error" of Repy into the servicelogger log. See below for a traceback. This is because itimport
s a library inside of thehandle_internalerror
function rather than in the outmost scope (where it would be executed whentracebackrepy
itself is imported).Since it's probably a good idea to keep
safe.py
as paranoid about builtins as it is, the workaround will be to move the import ofservicelogger
out of the function.@DennisMirante suggested a patch whose gist is to move the import to the top,
and then use
service_logger
in place ofservicelogger
inhandle_internalerrror
.(With this, we need to check that
service_logger
is not callable from within Repy code.)Here's an emanation of the problem, as reported by @yyzhuang.
The text was updated successfully, but these errors were encountered: