I have been trying to get the gdbm module in python 2.4 to read a gdbm file from python 1.5.2 and having no luck. I get a file error when I try to open the 1.5.2-created gdbm file.
Even a very simple gdbm database causes the trouble. E.g. I create a one-entry db in python 1.5.2
Then when I try to open the file in python 2.4
So, I am stuck. Is there some way to tell which version of GDBM is being used in python 1.5.2? The versions I have been playing with in 2.4 are GDBM 1.7.2 and 1.8.3.
BTW, I have to be able to read the gdbm files created in python 1.5.2 in a more recent version of python - I have no choice in that. Doing everything in the same python is not an option here.
[If this belongs in the DB section of the board, please feel free to move it. I have only played with gdbm files in python, and I don't see an area for gdbm specifically, so I posted here.]
Even a very simple gdbm database causes the trouble. E.g. I create a one-entry db in python 1.5.2
Code:
Python 1.5.2 (#0, Apr 13 1999, 10:51:12) [MSC 32 bit (Intel)] on win32 Copyright 1991-1995 Stichting Mathematisch Centrum, Amsterdam >>> import gdbm >>> db2 = gdbm.open(r'C:\test.gdbm','n') >>> db2['key1']='spiffweed' >>> db2.close()
Code:
Python 2.4 (#1, Dec 4 2004, 20:10:33) [GCC 3.3.3 (cygwin special)] on cygwin Type "help", "copyright", "credits" or "license" for more information. >>> import gdbm >>> db = gdbm.open(r"c:\test.gdbm","r") Traceback (most recent call last): File "<stdin>", line 1, in ? gdbm.error: File read error
BTW, I have to be able to read the gdbm files created in python 1.5.2 in a more recent version of python - I have no choice in that. Doing everything in the same python is not an option here.
[If this belongs in the DB section of the board, please feel free to move it. I have only played with gdbm files in python, and I don't see an area for gdbm specifically, so I posted here.]
Comment