473,473 Members | 1,902 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

shelve seg error

Hi,

I just installed (compiled) Python 2.4.2 under Suse 10.

The following code generates a seg error:

import shelve
print shelve.open ('test')

I assume this has to do with the db behind shelve.

How do I go about tracing/fixing the problem ?

Regards,

Philippe

Dec 6 '05 #1
5 1326
PS:

This code however works, which seems to me means the problem is with the
default database used by shelve ... which one is it ?
import shelve
import gdbm

def gdbm_shelve(filename, flag="c"):
return shelve.Shelf(gdbm.open(filename, flag))

db = gdbm_shelve("dbfile")
Regards,

Philippe


On Tue, 06 Dec 2005 05:53:22 -0600, Philippe C. Martin wrote:
Hi,

I just installed (compiled) Python 2.4.2 under Suse 10.

The following code generates a seg error:

import shelve
print shelve.open ('test')

I assume this has to do with the db behind shelve.

How do I go about tracing/fixing the problem ?

Regards,

Philippe


Dec 6 '05 #2
Philippe C. Martin wrote:
This code however works, which seems to me means the problem is with the
default database used by shelve ... which one is it ?


http://docs.python.org/lib/module-anydbm.html

</F>

Dec 6 '05 #3
Can I ask anydb which db it's using ?

Regards,

Philippe

On Tue, 06 Dec 2005 15:07:19 +0100, Fredrik Lundh wrote:
Philippe C. Martin wrote:
This code however works, which seems to me means the problem is with the
default database used by shelve ... which one is it ?


http://docs.python.org/lib/module-anydbm.html

</F>


Dec 6 '05 #4
Philippe C. Martin wrote:
Can I ask anydb which db it's using ?


the page says

If the database file already exists, the whichdb module is used to determine its
type and the appropriate module is used; if it does not exist, the first module
listed above that can be imported is used

where "above" refers to the list

dbhash (requires bsddb), gdbm, or dbm. If none of these modules is installed,
the slow-but-simple implementation in module dumbdbm will be used.

so the culprit in your case is either whichdb itself, or dbhash/bsddb...

</F>

Dec 6 '05 #5
OK, Thanks

On Tue, 06 Dec 2005 15:41:08 +0100, Fredrik Lundh wrote:
Philippe C. Martin wrote:
Can I ask anydb which db it's using ?


the page says

If the database file already exists, the whichdb module is used to determine its
type and the appropriate module is used; if it does not exist, the first module
listed above that can be imported is used

where "above" refers to the list

dbhash (requires bsddb), gdbm, or dbm. If none of these modules is installed,
the slow-but-simple implementation in module dumbdbm will be used.

so the culprit in your case is either whichdb itself, or dbhash/bsddb...

</F>


Dec 7 '05 #6

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...
0
by: seth | last post by:
Last week I encountered an AttributeError in my unit tests that I wasn'table to catch with an "except AttributeError" statement. The problem stemmed from a class that raised an error inside...
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...
0
by: Michael Mulcahy | last post by:
Hi All, Problem: Shelve module doesn't like me OS: Win2000 version: 2.3.3 Here is simple reproduction code and the error that occurs: import shelve, anydbm
0
by: Ray O | last post by:
I have read a number of threads relating to problems with shelve, but I couldn't find one directly related my experience, so I would appreciate some advice. The closest one ended with a...
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...
6
by: aomighty | last post by:
I wanted to write the following code: import shelve try: db = shelve.open(file, "r") except SomeError: print "Oh no, db not found" Only, I'm not sure what SomeError should be. I tried...
13
by: 7stud | last post by:
test1.py: -------------------- import shelve s = shelve.open("/Users/me/2testing/dir1/aaa.txt") s = "red" s.close() --------output:------ $ python test1.py
5
by: gluckj | last post by:
Hi, I'm not a Win ME fan myself (I'm a Mac user), but I'm here in Thailand developing software for special-needs kids, and the test PC in my home office is a Win ME machine (sigh). So when I...
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...
1
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
1
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
1
muto222
php
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence...

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.