cannot unmarshal code objects in restricted execution mode

Sam Brauer sam at webslingerZ.com
Tue Jun 18 21:59:38 CEST 2002


In the context of a long-running Python process (specifically mod_python) 
I occasionally get the following error:

exceptions.RuntimeError: cannot unmarshal code objects in restricted 
execution mode
File "/usr/local/lib/python2.2/encodings/__init__.py", line 51, in 
search_function
mod = __import__(modname,globals(),locals(),'*')

This happens when I call code like this:

utf8string = unicode(val, enc).encode('utf-8')

where 'val' is a string in an encoding identified by the string 'enc'.

What's strange is that the vast majority of the time the error doesn't 
occur, but after it happens once, it seems to happen more frequently 
(although not consistently).

Does anyone know what might be the cause of this error?

-- 
Sam Brauer
Systems Programmer
sam at webslingerZ.com







More information about the Python-list mailing list