Author Claudiu.Popa
Recipients Claudiu.Popa
Date 2013-10-25.06:38:40
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1382683121.03.0.174486602388.issue19385@psf.upfronthosting.co.za>
In-reply-to
Content
This problem occurred in issue19282. Basicly, dbm.dumb is not consistent with dbm.gnu and dbm.ndbm when the database is closed, as seen in the following:


>>> import dbm.dumb as d
>>> db = d.open('test.dat', 'c')
>>> db.close()
>>> db.keys()
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/tank/libs/cpython/Lib/dbm/dumb.py", line 212, in keys
    return list(self._index.keys())
AttributeError: 'NoneType' object has no attribute 'keys'
>>>

vs

>>> import dbm.gnu as g
>>> db = g.open('test.dat', 'c')
>>> db.close()
>>> db.keys()
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
_gdbm.error: GDBM object has already been closed
>>>

Attaching a patch.
History
Date User Action Args
2013-10-25 06:38:41Claudiu.Popasetrecipients: + Claudiu.Popa
2013-10-25 06:38:41Claudiu.Popasetmessageid: <1382683121.03.0.174486602388.issue19385@psf.upfronthosting.co.za>
2013-10-25 06:38:40Claudiu.Popalinkissue19385 messages
2013-10-25 06:38:40Claudiu.Popacreate