New submission from Arfrever Frehtes Taifersar Arahesis:

__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

----------
components: Library (Lib)
messages: 200305
nosy: Arfrever
priority: normal
severity: normal
status: open
title: __contains__()  of dbm.gnu databases fails with str
versions: Python 3.3, Python 3.4

_______________________________________
Python tracker <rep...@bugs.python.org>
<http://bugs.python.org/issue19288>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to