Error in shelve, keys() returns invalid argument...bug?

Thomas Weholt thomas at bibsyst.no
Mon Feb 14 02:23:22 EST 2000


wolf at one.net wrote:
> 
> I'm trying to use the shelve module in Win98SE in Python 1.52, and I
> can create the shelf just fine, but when I try to get the keys for the
> shelf it gives me an error. Here's a screen dump:
> 
> C:\APPS\Thief's Quest>"C:\Program Files\Python\PYTHON.EXE"
> 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 shelve
> >>> SavedGame = shelve.open("Test.psg")
> >>> SavedGame
> <shelve.DbfilenameShelf instance at 79b120>
> >>> SavedGame.keys
> <method Shelf.keys of DbfilenameShelf instance at 79b120>
> >>> SavedGame.keys()
> Traceback (innermost last):
>   File "<stdin>", line 1, in ?
>   File "C:\Program Files\Python\Lib\shelve.py", line 55, in keys
>     return self.dict.keys()
> bsddb.error: (22, 'Invalid argument')
> >>>
> 
> Am I doing something wrong? Or does the shelve module need an
> additional module in Win98 that doesn't come with the base install?
> 
> Any help would be appreciated!
> Respectfully,
> 
> Wolf
> 
> "The world is my home, it's just that some rooms are draftier than
> others". -- Wolf

I`ve experienced this too. Code that worked fine on Linux failed just
like this on Windows. Is the bsddb-module implementation the problem??

Thomas



More information about the Python-list mailing list