Author sam-s
Recipients sam-s
Date 2018-03-19.21:44:11
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1521495851.1.0.467229070634.issue33106@psf.upfronthosting.co.za>
In-reply-to
Content
deleting a key from a read-only gdbm should be gdbm.error, not KeyError:


>>> import gdbm
>>> db = gdbm.open("foo","n")   # create new
>>> db["a"] = "b"
>>> db.close()
>>> db = gdbm.open("foo","r")   # read only
>>> db["x"] = "1"
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
gdbm.error: Reader can't store    # correct
>>> db["a"]
'b'
>>> del db["a"]
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
KeyError: 'a'    # WRONG!  should be the same as above
History
Date User Action Args
2018-03-19 21:44:11sam-ssetrecipients: + sam-s
2018-03-19 21:44:11sam-ssetmessageid: <1521495851.1.0.467229070634.issue33106@psf.upfronthosting.co.za>
2018-03-19 21:44:11sam-slinkissue33106 messages
2018-03-19 21:44:11sam-screate