classification
Title: __contains__() of dbm.gnu databases fails with str
Type: behavior Stage: resolved
Components: Library (Lib) Versions: Python 3.4, Python 3.3
process
Status: closed Resolution: fixed
Dependencies: Superseder:
Assigned To: serhiy.storchaka Nosy List: Arfrever, python-dev, serhiy.storchaka
Priority: normal Keywords: easy, patch

Created on 2013-10-18 20:23 by Arfrever, last changed 2013-10-24 21:12 by serhiy.storchaka. This issue is now closed.

Files
File name Uploaded Description Edit
issue19288.patch Arfrever, 2013-10-19 18:32 review
Messages (3)
msg200305 - (view) Author: Arfrever Frehtes Taifersar Arahesis (Arfrever) * Date: 2013-10-18 20:23
__contains__()  of dbm.gnu databases fails with str.
This is inconsistent with other databases (dbm.ndbm (issue #19287) and dbm.dumb).


$ python3.2 -c 'import dbm.ndbm; db=dbm.ndbm.open("/tmp/ndbm_db", "c"); db["key"]="value"; print(b"key" in db); print("key" in db)'
True
True
$ python3.4 -c 'import dbm.dumb; db=dbm.dumb.open("/tmp/dumb_db", "c"); db["key"]="value"; print(b"key" in db); print("key" in db)'
True
True
$ python3.4 -c 'import dbm.gnu; db=dbm.gnu.open("/tmp/gdbm_db", "c"); db["key"]="value"; print(b"key" in db); print("key" in db)'
True
Traceback (most recent call last):
  File "<string>", line 1, in <module>
TypeError: gdbm key must be bytes, not str
msg200819 - (view) Author: Serhiy Storchaka (serhiy.storchaka) * (Python committer) Date: 2013-10-21 18:21
LGTM.
msg201187 - (view) Author: Roundup Robot (python-dev) Date: 2013-10-24 21:08
New changeset 09ed1b3b54f3 by Serhiy Storchaka in branch '3.3':
Issue #19288: Fixed the "in" operator of dbm.gnu databases for string
http://hg.python.org/cpython/rev/09ed1b3b54f3

New changeset 379372612f6d by Serhiy Storchaka in branch 'default':
Issue #19288: Fixed the "in" operator of dbm.gnu databases for string
http://hg.python.org/cpython/rev/379372612f6d
History
Date User Action Args
2013-10-24 21:12:01serhiy.storchakasetstatus: open -> closed
resolution: fixed
stage: patch review -> resolved
2013-10-24 21:08:46python-devsetnosy: + python-dev
messages: + msg201187
2013-10-21 18:21:17serhiy.storchakasetnosy: + serhiy.storchaka
messages: + msg200819

assignee: serhiy.storchaka
type: behavior
2013-10-19 18:32:28Arfreversetkeywords: + easy, patch
files: + issue19288.patch
stage: patch review
2013-10-18 20:23:13Arfrevercreate