restricted mode???

R

Robin Becker

A reportlab user running via mod_python+django (Python 2.5.2 and mod_python
3.3.1) reports a strange intermittent error involving failure to read files
which are known to be present.

After some debugging efforts we got this clearer error message


File "/usr/lib/python2.5/site-packages/reportlab/lib/utils.py", line 810,
in dump
f = open(self.fn,'wb')

IOError: file() constructor not accessible in restricted mode

this is not the original error, but part of our efforts to debug; however, the
original error was during an attempt to read a file so presumably open was not
available there.

Googling the error indicates something to do with restricted
environments/mod_python+threads.

I thought that restricted mode died ages ago.

Any ideas what could be causing this?
 
M

Martin v. Löwis

I thought that restricted mode died ages ago.
Any ideas what could be causing this?

Restricted mode is still available, and activated whenever
a frame's builtins directory is different from the interpreter's;
see PyFrame_IsRestricted.

Regards,
Martin
 
R

Robin Becker

Martin said:
Restricted mode is still available, and activated whenever
a frame's builtins directory is different from the interpreter's;
see PyFrame_IsRestricted.

Regards,
Martin
thanks very much, I saw some references to mod_python & threading related to
this, but nothing very obvious.
 
R

Robin Becker

Martin said:
Restricted mode is still available, and activated whenever
a frame's builtins directory is different from the interpreter's;
see PyFrame_IsRestricted.

Regards,
Martin
thanks very much, I saw some references to mod_python & threading related to
this, but nothing very obvious.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,997
Messages
2,570,239
Members
46,827
Latest member
DMUK_Beginner

Latest Threads

Top