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 sam-s
Recipients ezio.melotti, sam-s, vstinner
Date 2017-09-08.20:54:57
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1504904097.33.0.298088172041.issue31398@psf.upfronthosting.co.za>
In-reply-to
Content
`in` and `has_key` have different behavior for Unicode keys for `gdbm` in 2.7:
```
>>> import gdbm
>>> db = gdbm.open("foo.gdbm","c")
>>> db.has_key("a")
0
>>> db.has_key(u"a")
0
>>> "a" in db
False
>>> u"a" in db
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
TypeError: gdbm key must be string, not unicode
```
History
Date User Action Args
2017-09-08 20:54:57sam-ssetrecipients: + sam-s, vstinner, ezio.melotti
2017-09-08 20:54:57sam-ssetmessageid: <1504904097.33.0.298088172041.issue31398@psf.upfronthosting.co.za>
2017-09-08 20:54:57sam-slinkissue31398 messages
2017-09-08 20:54:57sam-screate