shelve seg error

  • Thread starter Philippe C. Martin
  • Start date
P

Philippe C. Martin

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
 
P

Philippe C. Martin

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
 
F

Fredrik Lundh

Philippe said:
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>
 
P

Philippe C. Martin

OK, Thanks

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>
 

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,780
Messages
2,569,611
Members
45,279
Latest member
LaRoseDermaBottle

Latest Threads

Top