473,387 Members | 1,864 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,387 software developers and data experts.

Help... Use Shelve in CGI script? -- Nevermind

Hello,

I recently came across the shelve module and fell in love with it. It
works fine on the command line... But when I put the same code into the cgi
script it crashes everytime. Here's the output from the cgi crash.

Traceback (most recent call last):
File "/var/www/cgi-bin/test.cgi", line 8, in ?
db = shelve.open("register", "c")
File "/usr/lib/python2.3/shelve.py", line 231, in open
return DbfilenameShelf(filename, flag, protocol, writeback, binary)
File "/usr/lib/python2.3/shelve.py", line 212, in __init__
Shelf.__init__(self, anydbm.open(filename, flag), protocol, writeback,
binar
y)
File "/usr/lib/python2.3/anydbm.py", line 83, in open
return mod.open(file, flag, mode)
File "/usr/lib/python2.3/dbhash.py", line 16, in open
return bsddb.hashopen(file, flag, mode)
File "/usr/lib/python2.3/bsddb/__init__.py", line 192, in hashopen
d.open(file, db.DB_HASH, flags, mode)
bsddb._db.DBAccessError: (13, 'Permission denied')
Exception exceptions.AttributeError: "DbfilenameShelf instance has no
attribute
'writeback'" in ignored
[Wed Nov 24 00:49:37 2004] [error] [client 127.0.0.1] Premature end of
script he
aders: /var/www/cgi-bin/test.cgi

---------

Now this line bsddb._db.DBAccessError: (13, 'Permission denied') says
permission denied. How do I get the permission to use it in my cgi script
for the Apache web server? I tried already having a valid... oh wait. I
got it.

The way I just got it working is as follows. I generated a database file in
my home folder. (Cause another error I was getting was wrong database
lookup). So I took this working database file and put it in my cgi
directory. Then to make it work I changed it to world readable and
writable. Then the cgi script ran just fine :-).
Jul 18 '05 #1
0 1110

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

6
by: Rami A. Kishek | last post by:
Hi - this mysterious behavior with shelve is just about to kill me. I hope someone here can shed some light. First of all, I have this piece of code which uses shelve to save instances of some...
1
by: Eric Wichterich | last post by:
Hello Pythonistas, I use Python shelves to store results from MySQL-Queries (using Python for web scripting). One script searches the MySQL-database and stores the result, the next script reads...
0
by: Blair Hall | last post by:
I am having trouble understanding the correct use of 'shelve'. I have a number of small programs that read and write to a single shelve file (not multithreading though). It seems that by...
0
by: ex laguna | last post by:
Hi, I have ran into a problem with py2exe 0.5.0 and shelve in python 2.3.3. The script works fine standalone, but not with py2exe. Does anyone have a solution of workaround for this? Thanks...
4
by: Terry Hancock | last post by:
I only just recently had a look at the shelve module, and it looks pretty handy, my only question being, what if I really want two shelves? Must I use two files? Also, it seems strange that...
3
by: Michele Petrazzo | last post by:
Hi, I'm trying a script on a debian 3.1 that has problems on shelve library. The same script work well on a fedora 2 and I don't know why it create this problem on debian: #extract from my code...
1
by: Matthew Schibler | last post by:
I'm a newbie to Python, with some experience using perl (where I used nested arrays and hashes extensively). I am building a script in python for a MUD I play, and I want to use the shelve module...
2
by: hypermonkey2 | last post by:
Hi there! I am using the "shelve" module in a script to save information in between runtime sessions of the program. (its a sort of data collector, so its important to hold on to anything computed...
0
by: Edwin.Madari | last post by:
since choice of dbm used by shelve http://docs.python.org/lib/node327.html depends on os, and whats available on it, shevle files saved on one os, most likely do not work on another os, sometimes on...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.