[tor-bugs] #4414 [Thandy]: ScriptWrapper should be multiplatform
Tor Bug Tracker & Wiki
torproject-admin at torproject.org
Wed Nov 9 20:20:36 UTC 2011
#4414: ScriptWrapper should be multiplatform
--------------------+-------------------------------------------------------
Reporter: chiiph | Owner: nickm
Type: defect | Status: needs_review
Priority: normal | Milestone:
Component: Thandy | Version:
Keywords: | Parent:
Points: | Actualpoints:
--------------------+-------------------------------------------------------
Comment(by nickm):
Replying to [comment:6 chiiph]:
> Replying to [comment:4 nickm]:
> > How is it better than eval? It changes our language from "Python" to
"Not really Python". Taking a quick look at the source for code.py, I see
that internally all it's really doing is calling compile() and exec().
>
> eval will execute the code in the same environment (not just in terms of
os.environ) than the rest of Thandy (and the same applies to compile/exec,
afaict). With InteractiveInterpreter, it runs as if a new python process
was doing it. I'll take a look at code.py and figure out a better way of
doing this.
It does this by calling exec in order to get a new set of globals and
locals. Really, that's all it's doing for isolation. You can do the same
with execfile.
--
Ticket URL: <https://trac.torproject.org/projects/tor/ticket/4414#comment:8>
Tor Bug Tracker & Wiki <https://trac.torproject.org/>
The Tor Project: anonymity online
More information about the tor-bugs
mailing list