This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author Arfrever
Recipients Arfrever
Date 2013-10-18.20:23:13
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1382127793.56.0.416420933735.issue19288@psf.upfronthosting.co.za>
In-reply-to
Content
__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
History
Date User Action Args
2013-10-18 20:23:13Arfreversetrecipients: + Arfrever
2013-10-18 20:23:13Arfreversetmessageid: <1382127793.56.0.416420933735.issue19288@psf.upfronthosting.co.za>
2013-10-18 20:23:13Arfreverlinkissue19288 messages
2013-10-18 20:23:13Arfrevercreate