python / python/cpython

Add structured version info for dbm.ndbm

Open
#157,480 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

3.16 extension-modules type-feature
Dominant language
Python
Stars
77.2k
Forks
35.9k
PR merge metrics
PR metrics pending

Description

Feature or enhancement

dbm.ndbm can be built with GDBM's compatibility interface, with Berkeley DB, or with a classic NDBM library, and only exposes library, the name of the implementation. No version information is available, and library is 'GNU gdbm' even for a classic NDBM library, because the USE_NDBM build assumes GDBM.

The library used by dbm.ndbm may differ from the one used by dbm.gnu (different builds of GDBM, or Berkeley DB), so dbm.ndbm needs its own constants, named after the library it was built with:

  • if library is 'GNU gdbm': GDBM_VERSION_INFO, gdbm_version_info and gdbm_version, as in dbm.gnu (gh-157478).
  • if library is 'Berkeley DB': DB_VERSION and DB_VERSION_INFO for the build-time version (DB_VERSION_STRING, DB_VERSION_MAJOR/MINOR/PATCH), db_version and db_version_info for the runtime version (db_version()).
  • for a classic NDBM library there is no version information; library should be 'ndbm'.
Linked PRs
  • gh-157484

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with the dbm.ndbm implementation and compare its exposed library information with dbm.gnu, as referenced by gh-157478. Check the build-time and runtime version requirements for GNU gdbm and Berkeley DB, and verify that classic NDBM reports no version information and identifies itself as ndbm; gh-157484 indicates work is already underway.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
databases
Issue type
Feature
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.