Issue 897820: db4 4.2 == :-( (test_anydbm and test_bsddb3) (original) (raw)

This machine, running fedora core 2 (test) has db4 4.2.52 installed. test_anydbm fails utterly with this combination. 3 of the 4 tests fail, the failing part is the same in each case:

File "Lib/anydbm.py", line 83, in open return mod.open(file, flag, mode) File "Lib/dbhash.py", line 16, in open return bsddb.hashopen(file, flag, mode) File "Lib/bsddb/init.py", line 293, in hashopen d.open(file, db.DB_HASH, flags, mode) DBInvalidArgError: (22, 'Invalid argument -- DB_TRUNCATE illegal with locking specified')

test_bsddb passes, but test_bsddb3 fails with a similar error:

test test_bsddb3 failed -- Traceback (most recent call last): File "Lib/bsddb/test/test_compat.py", line 82, in test04_n_flag f = hashopen(self.filename, 'n') File "Lib/bsddb/init.py", line 293, in hashopen d.open(file, db.DB_HASH, flags, mode) DBInvalidArgError: (22, 'Invalid argument -- DB_TRUNCATE illegal with locking specified')

Logged In: YES user_id=413

As Tim Peters pointed out on python-dev in march:

I suspect Sleepycat screwed us there, changing the rules in midstream. Someone on c.l.py appeared to track down the same thing here, but in an app instead of in our test suite:

http://mail.python.org/pipermail/python-list/2004-May/220168.html

The change log of Berkeley DB 4.2.52 says "9. Fix a

bug to now disallow DB_TRUNCATE on opens in locking environments, since we cannot prevent race conditions ..."

leaving the bug open until i look to see if there is a workaround.

Logged In: YES user_id=29957

Regardless of whether there's a workaround or not, the test suite should not fail. Fedora Core is a fairly well known distro, and while FC2 is probably the first to ship with db 4.2, I'm sure it won't be the last.