[issue33106] Deleting a key in a read-only gdbm results in KeyError, not gdbm.error

2018-12-12 Thread Xiang Zhang
Change by Xiang Zhang : -- resolution: -> fixed stage: patch review -> resolved status: open -> closed type: behavior -> enhancement ___ Python tracker ___

[issue33106] Deleting a key in a read-only gdbm results in KeyError, not gdbm.error

2018-12-12 Thread Xiang Zhang
Xiang Zhang added the comment: New changeset 4fb0b8bc25c52aae8dcb4353e69c1c88999a9a53 by Xiang Zhang in branch 'master': bpo-33106: change dbm key deletion error for readonly file from KeyError to dbm.error (#6295)

[issue33106] Deleting a key in a read-only gdbm results in KeyError, not gdbm.error

2018-06-08 Thread sds
sds added the comment: I think consistency would be nice -- so, yes, `dbm.dumb.error` instead of `ValueError` (or at least a subtype of `dbm.dumb.error`). Thanks! -- ___ Python tracker

[issue33106] Deleting a key in a read-only gdbm results in KeyError, not gdbm.error

2018-03-28 Thread Xiang Zhang
Change by Xiang Zhang : -- keywords: +patch pull_requests: +6019 stage: -> patch review ___ Python tracker ___

[issue33106] Deleting a key in a read-only gdbm results in KeyError, not gdbm.error

2018-03-28 Thread Xiang Zhang
Xiang Zhang added the comment: I like this idea. But this is a behavior change so I think it could only be applied to master branch. But there is a problem, except dbm.gnu and dbm.ndbm, we also get dbm.dumb. It already raises a ValueError when deleting a key in readonly

[issue33106] Deleting a key in a read-only gdbm results in KeyError, not gdbm.error

2018-03-19 Thread sds
sds added the comment: Same problem with 3.6.4, start with >>> from dbm import gnu as gdbm then the same incorrect behavior -- versions: +Python 3.6 -Python 2.7 ___ Python tracker

[issue33106] Deleting a key in a read-only gdbm results in KeyError, not gdbm.error

2018-03-19 Thread sds
New submission from sds : 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