Skip to main content

Allows using gdbm files created with version 1.8 or 1.10, without magic number errors.

Project description

Provides a means to open a gdbm database that otherwise gives the “Bad Magic Number” error.

This can be useful when needing to support EL6 and EL7 (or CentOS 6 and CentOS 7).

It supports opening of gdbm files created with gdbm version 1.8 or 1.10. Some functionality may not work on the database, but most will, which is better than none!

The primary method of usage is to use “gdbm_compat.open_compat” in place of “gdbm.open”.

For example:

>>> import gdbm_compat
>>> ...
>>> mydb = gdbm.open('mydatabase', 'r') # Database created on different system that wont open

Traceback (most recent call last):

File “<stdin>”, line 1, in <module>

gdbm.error: Bad magic number

>>> mydb = gdbm_compat.open_compat('mydatabase.db', 'r') # Force it to open

<gdbm.gdbm object at 0x7f7da47ee110>

Commandline Interface

Usage: gdbm-compat-convert [-1.8/-1.10] [input filename] [output filename]

Changes the magic number on a gdbm database, to make it accessable on different platforms.

Changing to either version 1.8 or 1.10 are supported, provide that as the first argument.

If no “output filename” is provided, the change will be made inline.

Additional Methods

Some additional methods are available. You can find the pydoc generated documentation in doc/gdbm_compat.html of the source distribution.

License

gdbm_compat is licensed under Public Domain.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

gdbm_compat-3.0.1.tar.gz (5.8 kB view details)

Uploaded Source

File details

Details for the file gdbm_compat-3.0.1.tar.gz.

File metadata

  • Download URL: gdbm_compat-3.0.1.tar.gz
  • Upload date:
  • Size: 5.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No

File hashes

Hashes for gdbm_compat-3.0.1.tar.gz
Algorithm Hash digest
SHA256 920347e61925fd936d880dd80e08252cef9dc2098a803f73487ee670784b1753
MD5 961097448030a2c160e3c47ece2d3985
BLAKE2b-256 bca531b2b9627fa31dc410b692224e300d5ffe289cd3dfcf7ddf9aaa632c9fdd

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page