[mod_python] Using mod_python and shelve module

Michael Krasnovsky mk at lrn.ru
Fri Oct 25 20:14:22 EST 2002


Hi!

I try using standard python module shelve in my publisher handler, but I
got the error:

Mod_python error: "PythonHandler mod_python.publisher"
Traceback (most recent call last):

  File "/usr/lib/python2.2/site-packages/mod_python/apache.py", line
193, in Dispatch
    result = object(req)

  File "/usr/lib/python2.2/site-packages/mod_python/publisher.py", line
171, in handler
    result = apply(object, (), args)

  File "/home/mk/www/test2.py", line 7, in handle
    sessiondict = shelve.open('/tmp/apptest.session', 'c')

  File "/usr/lib/python2.2/shelve.py", line 158, in open
    return DbfilenameShelf(filename, flag)

  File "/usr/lib/python2.2/shelve.py", line 148, in __init__
    Shelf.__init__(self, anydbm.open(filename, flag))

  File "/usr/lib/python2.2/anydbm.py", line 86, in open
    return mod.open(file, flag, mode)

  File "/usr/lib/python2.2/dbhash.py", line 16, in open
    return bsddb.hashopen(file, flag, mode)

error: (13, 'Permission denied')


What's the problem? I check permissions of /tmp/ directory - it's OK.
BTW, I wrote simple cgi script with using shelve and it works fine.
I run mod_pytnon 2.7.8+Apache 1.3.27 on Linux. Python version 2.2.1.

Thanks for any help.

-- 
Michael Krasnovsky

E mk at lrn.ru



More information about the Mod_python mailing list