Python says bad magic number

khassan at khassan at
Tue Aug 10 15:47:26 CEST 1999


I am having trouble using python with database modules. I have a simple
script called "test" as follows:


import gdbm
db ='detail', 'r')
print "There are", len(db), "keys in the database"
for key in db.keys():
        print key, db[key]

I get errors if I run the script as follows:

#python test
Traceback (innermost last):
  File "test", line 4, in ?
    db ='/usr/src/radiusContext-1.54/temp/detail', 'r')
gdbm.error: Bad magic number

What does this mean? I am using Linux 2.0.36, libc 5.4.46, python
1.5.2, gdbm 1.8.0, db 1.85.4. The detail file is actually the logfile
produced by cistron radius program (it is in livingston format).

khassan at

Sent via
Share what you know. Learn what you don't.

More information about the Python-list mailing list