[mod_python] All spawned threads in Restricted Exection Mode

Alan Davies alan at goatpunch.com
Wed Mar 30 14:45:27 EST 2005


Hi,

I've seen some comments on this problem in the past, and was wondering
if a fix/workaround has ever emerged.

It seems that when I spawn a thread in mod_python, the thread runs in
Restricted Execution Mode. I get errors like this when I try to do
simple things such as import Python Image Library's 'Image' module:

    RuntimeError: cannot unmarshal code objects in restricted execution
    mode

The same code running in the main thread works fine. I've tried python
versions 2.2 and 2.3, and just tried installing the latest versions I
could find: Apache/2.0.53 (Win32) mod_python/3.1.4 Python/2.4 - problem
is still there. A few months ago I had this code up and running on
this same machine, probably with Python 2.3.

Another machine with this configuration has no problem: Apache/2.0.52
(Win32) mod_python/3.1.3 Python/2.3.2

This is a very annoying problem; the ability to have a thread running
that persists across and interacts with http requests is my reason for
using mod_python, any ideas how I can solve this?

Thanks,

--Alan


More information about the Mod_python mailing list