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

Discussion in 'Python' started by Dan M, Oct 26, 2005.

  1. Dan M

    Dan M Guest

    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)"
    Dan M, Oct 26, 2005
    #1
    1. Advertising

  2. Dan M

    Guest

    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
    , Oct 26, 2005
    #2
    1. Advertising

  3. Dan M

    Dan M Guest

    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!
    Dan M, Oct 26, 2005
    #3
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Harald Massa
    Replies:
    0
    Views:
    340
    Harald Massa
    Sep 16, 2003
  2. Dan Olsen

    Python and Berkeley XML DB

    Dan Olsen, Jul 13, 2004, in forum: Python
    Replies:
    1
    Views:
    604
    vincent wehren
    Jul 13, 2004
  3. Silvia

    Image not recognized format

    Silvia, Jul 5, 2004, in forum: ASP General
    Replies:
    2
    Views:
    101
    Bullschmidt
    Jul 5, 2004
  4. 187
    Replies:
    4
    Views:
    203
    Paul Marquess
    Apr 6, 2004
  5. Wesley
    Replies:
    1
    Views:
    110
    Wesley
    Apr 15, 2014
Loading...

Share This Page