FAQ
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)"

Search Discussions

  • Skip at Oct 26, 2005 at 7:23 pm
    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
    import bsddb185
    dir(bsddb185)
    ['__doc__', '__file__', '__name__', 'btopen', 'error', 'hashopen', 'open',
    'rnopen']
    dir(bsddb)
    ['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
  • Dan M at Oct 26, 2005 at 7:38 pm

    On Wed, 26 Oct 2005 14:23:49 -0500, skip wrote:
    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!

Related Discussions

Discussion Navigation
viewthread | post
Discussion Overview
grouppython-list @
categoriespython
postedOct 26, '05 at 6:07p
activeOct 26, '05 at 7:38p
posts3
users2
websitepython.org

2 users in discussion

Dan M: 2 posts Skip: 1 post

People

Translate

site design / logo © 2022 Grokbase