Skip to main content

gdbm_compat

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.

Metadata

Release files for gdbm_compat 3.0.1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for gdbm_compat 3.0.1
File Size Uploaded
gdbm_compat-3.0.1.tar.gz 5.8 kB Details

Release files / gdbm_compat-3.0.1.tar.gz

Download URL gdbm_compat-3.0.1.tar.gz
Size 5.8 kB
Tags Source
SHA-256 checksum
How to use checksums
920347e61925fd936d880dd80e08252cef9dc2098a803f73487ee670784b1753
BLAKE2b-256 checksum
How to use checksums
bca531b2b9627fa31dc410b692224e300d5ffe289cd3dfcf7ddf9aaa632c9fdd
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No

Release history Release notifications | RSS feed

This release

3.0.1 This release

1 release file

3.0.0

1 release file

2.0.1

1 release file

2.0.0

1 release file

1.0.2

1 release file

1.0.1

1 release file

1.0.0

1 release file

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page