shelve.open() and error 22: invalid argument


M

max.aginaga

Hi everyone

I've come across the following problem: on two different linux
machines, both running python 2.5 (r25:51908), I have the same file
'd.dat'. The md5 checksums are the same.

Now, on one machine the following code works

while on the other...

Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "local/lib/python2.5/shelve.py", line 225, in open
return DbfilenameShelf(filename, flag, protocol, writeback)
File "local/lib/python2.5/shelve.py", line 209, in __init__
Shelf.__init__(self, anydbm.open(filename, flag), protocol,
writeback)
File "local/lib/python2.5/anydbm.py", line 83, in open
return mod.open(file, flag, mode)
File "local/lib/python2.5/dbhash.py", line 16, in open
return bsddb.hashopen(file, flag, mode)
File "local/lib/python2.5/bsddb/__init__.py", line 299, in hashopen
e = _openDBEnv(cachesize)
File "local/lib/python2.5/bsddb/__init__.py", line 355, in
_openDBEnv
e.set_lk_detect(db.DB_LOCK_DEFAULT)
bsddb.db.DBInvalidArgError: (22, 'Invalid argument')

What is happening? I am running the same Python interpreter on the
same file! Why different results? (To make things weirder, this
actually fails on the machine in which I created the d.dat file using
the shelve module!)

Please advise, knowledgeable pythoners! The archives are full of
references to this 22 invalid argument error msg, but precious few
anwers.

Cheers!

Max
 
Ad

Advertisements

J

Jonathan Gardner

Hi everyone

I've come across the following problem: on two different linux
machines, both running python 2.5 (r25:51908), I have the same file
'd.dat'. The md5 checksums are the same.

Now, on one machine the following code works


while on the other...

Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "local/lib/python2.5/shelve.py", line 225, in open
return DbfilenameShelf(filename, flag, protocol, writeback)
File "local/lib/python2.5/shelve.py", line 209, in __init__
Shelf.__init__(self, anydbm.open(filename, flag), protocol,
writeback)
File "local/lib/python2.5/anydbm.py", line 83, in open
return mod.open(file, flag, mode)
File "local/lib/python2.5/dbhash.py", line 16, in open
return bsddb.hashopen(file, flag, mode)
File "local/lib/python2.5/bsddb/__init__.py", line 299, in hashopen
e = _openDBEnv(cachesize)
File "local/lib/python2.5/bsddb/__init__.py", line 355, in
_openDBEnv
e.set_lk_detect(db.DB_LOCK_DEFAULT)
bsddb.db.DBInvalidArgError: (22, 'Invalid argument')

What is happening? I am running the same Python interpreter on the
same file! Why different results? (To make things weirder, this
actually fails on the machine in which I created the d.dat file using
the shelve module!)

This comes up outside of Python as well. Look into your BDB setup. I
bet you that the two machines have different versions of BDB
libraries.
 

Ask a Question

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

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top