restricted mode???

Discussion in 'Python' started by Robin Becker, Nov 4, 2009.

  1. Robin Becker

    Robin Becker Guest

    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?
    --
    Robin Becker
    Robin Becker, Nov 4, 2009
    #1
    1. Advertising

  2. > 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
    Martin v. Löwis, Nov 4, 2009
    #2
    1. Advertising

  3. Robin Becker

    Robin Becker Guest

    Martin v. Löwis wrote:
    >> 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

    thanks very much, I saw some references to mod_python & threading related to
    this, but nothing very obvious.
    --
    Robin Becker
    Robin Becker, Nov 5, 2009
    #3
  4. Robin Becker

    Robin Becker Guest

    Martin v. Löwis wrote:
    >> 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

    thanks very much, I saw some references to mod_python & threading related to
    this, but nothing very obvious.
    --
    Robin Becker
    Robin Becker, Nov 5, 2009
    #4
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. vinjvinj
    Replies:
    15
    Views:
    562
    Jeremy Sanders
    Nov 10, 2005
  2. Replies:
    0
    Views:
    252
  3. Wojciech Pawlikowski

    restricted mode (2.4.2)

    Wojciech Pawlikowski, Feb 17, 2006, in forum: Python
    Replies:
    0
    Views:
    395
    Wojciech Pawlikowski
    Feb 17, 2006
  4. Dmitri Fedoruk
    Replies:
    4
    Views:
    673
    Dmitri Fedoruk
    Sep 14, 2007
  5. Paul Rudin
    Replies:
    3
    Views:
    398
    Vinay Sajip
    Oct 21, 2007
Loading...

Share This Page