[Patches] [ python-Patches-766650 ] whichdb not ID'ing dbm files with GDBM backend

SourceForge.net noreply@sourceforge.net
Sun, 06 Jul 2003 04:09:51 -0700


Patches item #766650, was opened at 2003-07-06 21:09
Message generated for change (Tracker Item Submitted) made by Item Submitter
You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=305470&aid=766650&group_id=5470

Category: Modules
Group: Python 2.3
Status: Open
Resolution: None
Priority: 5
Submitted By: Andrew I MacIntyre (aimacintyre)
Assigned to: Nobody/Anonymous (nobody)
Summary: whichdb not ID'ing dbm files with GDBM backend

Initial Comment:
For the OS/2 EMX port, I build the dbm module with gdbm
v1.7.3.

At least with the OS/2 version of the gdbm v1.7.3 port,
dbm databases consist only of the .pag file - there is
no .dir file.

In this case, the .pag file has the gdbm magic number.

Currently whichdb fails to identify such dbm DBs on
this platform because of the expectation that there be
a .dir file as well as the .pag file.

I'm not in any position to confirm whether the dbm
module built with gdbm behaves the same way on other
systems -information gratefully received on this topic.

On the assumption that other platforms also have this
behaviour, the attached patch attempts to detect
whether a dbm DB has a gdbm signature just by checking
the magic number of the .pag file.

The patch involves a refactoring of the magic number
code, which may be deemed inappropriate.

It may be more expedient to just special case theEMX
port in the dbm detection (by skipping looking for the
.dir file on this platform).

----------------------------------------------------------------------

You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=305470&aid=766650&group_id=5470