[mod_python] Point of frustration/disappointment

Jim Popovitch jimpop at yahoo.com
Fri Jul 29 10:15:12 EDT 2005


On Fri, 2005-07-29 at 00:38 -0400, Graham Dumpleton wrote:
> Jim Gallacher wrote ..
> > Python. See http://www.python.org/doc/2.3/lib/module-rexec.html
> 
> The sort of error related to "restricted execution mode" is in all
> likelihood has got nothing to do with the "rexec" module. The checks for
> whether Python thinks it is running in restricted execution mode are
> much more low level than that. One can get these sort of problems in
> code totally unrelated to the "rexec" module.
> 
> I can't remember exactly, but what it all boils down to is that if a
> module replaces the "__builtins__" within its own global namespace with
> something that is different to "__builtin__.__dict__" then Python will
> set an internal flag associated with the execution context for that
> thread which says it is running in "restricted execution mode".
> 
> When in this mode any code which is executed which can't run in
> restricted execution mode will raise some sort of error like above. This
> specific error above isn't the only error that can occur.
> 
>  I once managed to create a half dozen line program which would
> illustrate this in action, but can't find it now and can't remember what
> I did to trigger it. :-(
> 
> Thus, one possibility is whether the package the problem occurs in
> fiddles with __builtins__ at all.
> 
> Anyway, if I find the test program which shows the problem or if I can
> work it out again, I'll post it.

Thanks Graham, it's a very interesting take on the issue.  I'll dig
around a bit in the app and see what it is trying to do.

-Jim P.





More information about the Mod_python mailing list