473,394 Members | 1,916 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,394 software developers and data experts.

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

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

Oct 26 '05 #1
2 3046

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 '05 #2
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!

Oct 26 '05 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

5
by: David Eppstein | last post by:
Does anyone have an implemented Python codec for converting between unicode and LaTeX markup? E.g. I'd like 'ï' to be converted to '{\"\i}' and vice versa. Preferably including at least the Latin...
1
by: Dan Olsen | last post by:
I am trying to install and use Berkeley XML DB with Python. However, I keep getting errors. The weblog at Sleepy Cat said to build Python with the latest version of Berkeley DB. I can't get it to...
4
by: Vent d'Est - East Wind | last post by:
Can somebody tell me what s exactly the difference beetween scheme and python languages i m thiking to learn one of them but i m not sure wich one somebody told me python is better and have...
0
by: Kurt B. Kaiser | last post by:
Patch / Bug Summary ___________________ Patches : 391 open ( +7) / 3028 closed (+12) / 3419 total (+19) Bugs : 906 open ( -3) / 5519 closed (+19) / 6425 total (+16) RFE : 207 open...
0
by: Kurt B. Kaiser | last post by:
Patch / Bug Summary ___________________ Patches : 378 open ( +3) / 3298 closed (+34) / 3676 total (+37) Bugs : 886 open (-24) / 5926 closed (+75) / 6812 total (+51) RFE : 224 open...
17
by: chewie54 | last post by:
Hello, As an electronics engineer I use some very expensive EDA CAD tool programs that are scriptable using Tcl. I was wondering why these companies have choose to use Tcl instead of Python. ...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
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
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
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
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...

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.