Python says bad magic number

khassan at aster.com.pk khassan at aster.com.pk
Tue Aug 10 15:47:26 CEST 1999


Hi,

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

#!/usr/local/bin/python

import gdbm
db = gdbm.open('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 = gdbm.open('/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).

Thanks,
Khurram,
khassan at aster.com.pk


Sent via Deja.com http://www.deja.com/
Share what you know. Learn what you don't.




More information about the Python-list mailing list