[New-bugs-announce] [issue13007] gdbm 1.9 has new magic that whichdb does not recognize

Marien Zwart report at bugs.python.org
Mon Sep 19 16:18:09 CEST 2011


New submission from Marien Zwart <m_zwart at 123mail.org>:

dbm.whichdb (python 3) and whichdb.whichdb (python 2) only check for "magic == 0x13579ace" to recognize gdbm databases. The recently released gdbm 1.9 series adds 0x13579acd (for "32bit") and 0x13579acf (for "64bit") magics (see src/gdbmconst.h in the gdbm-1.9 or gdbm-1.9.1 source tree). Python's gdbm linked to gdbm 1.9 creates databases with the new magic, which causes the whichdb tests to fail. To reproduce this just build python against the new libgdbm and run test/test_dbm.py.

whichdb should probably just check for the two new magic numbers too. This will cause it to recognize the new gdbm databases even if python's gdbm extension is linked to an older version of gdbm that cannot open them, but that is probably less likely to cause problems than the current behavior, where a database created by python's gdbm is not recognized as such.

(I've left the "Versions" field untouched as I do not know which versions of python this should be backported to, but it affects all of them.)

----------
components: Library (Lib)
messages: 144277
nosy: marienz
priority: normal
severity: normal
status: open
title: gdbm 1.9 has new magic that whichdb does not recognize
type: behavior

_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue13007>
_______________________________________


More information about the New-bugs-announce mailing list