Python 2.3.4, Berkeley db 1.85, db file format not recognized

D

Dan M

I'm working on a script that will interface with sendmail on my FreeBSD
box. I'm trying to read my access.db file (yes, it's for a quick and dirty
SMTP-after-POP application). I'm trying:

import bsddb
bsddb.hashopen("access.db")

but I get:
bsddb._db.DBInvalidArgError: (22, 'Invalid argument -- access.db: unexpected file type or format')

This suggests to me that my bsddb is too new. I really don't want to
rebuild sendmail with a more current db, as I'm afraid of breaking
sendmail. Any suggestions on how to read this file?

FWIW, "file access.db" returns "access.db: Berkeley DB 1.85 (Hash, version
2, native byte-order)"
 
S

skip

Dan> import bsddb
Dan> bsddb.hashopen("access.db")

Dan> but I get:
Dan> bsddb._db.DBInvalidArgError: (22, 'Invalid argument -- access.db: unexpected file type or format')

Dan> .... Any suggestions on how to read this file?

See if the bsddb185 module is available:

% python
Python 2.5a0 (#94, Oct 8 2005, 06:49:04)
[GCC 3.3 20030304 (Apple Computer, Inc. build 1671)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
impo>>> import bsddb ['__doc__', '__file__', '__name__', 'btopen', 'error', 'hashopen', 'open',
'rnopen'] ['UserDict', '_DBWithCursor', '__builtins__', '__doc__', '__file__',
'__name__', '__path__', '__version__', '_bsddb', '_checkflag', '_db',
'_iter_mixin', '_openDBEnv', 'btopen', 'db', 'error', 'hashopen', 'os',
'ref', 'rnopen', 'sys']

If the old libdb.a stuff is available, the bsddb185 module should have been
built automagically.

Skip
 
D

Dan M

Dan> import bsddb
Dan> bsddb.hashopen("access.db")

Dan> but I get:
Dan> bsddb._db.DBInvalidArgError: (22, 'Invalid argument -- access.db: unexpected file type or format')

Dan> .... Any suggestions on how to read this file?

See if the bsddb185 module is available:

It is, and it works. Thanks so much!
 

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

Forum statistics

Threads
473,766
Messages
2,569,569
Members
45,043
Latest member
CannalabsCBDReview

Latest Threads

Top