[issue31398] TypeError: gdbm key must be string, not unicode

2021-06-18 Thread Irit Katriel


Change by Irit Katriel :


--
stage:  -> resolved
status: open -> closed

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue31398] TypeError: gdbm key must be string, not unicode

2021-06-18 Thread STINNER Victor


STINNER Victor  added the comment:

IMO you can close it immediately. Fixing Python 2.7 is not going to happen ever.

--
status: pending -> open

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue31398] TypeError: gdbm key must be string, not unicode

2021-06-18 Thread Irit Katriel


Irit Katriel  added the comment:

This seems like a python 2-only issue, if nobody objects I will close it in a 
couple of weeks.

--
nosy: +iritkatriel
resolution:  -> out of date
status: open -> pending

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue31398] TypeError: gdbm key must be string, not unicode

2017-09-09 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

has_key(u"x") works if x is a valid key.

has_key() parses the argument with PyArg_ParseTuple("s#") which implicitly 
converts unicode to str. __contains__() explicitly checks for str type.

--
nosy: +serhiy.storchaka

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue31398] TypeError: gdbm key must be string, not unicode

2017-09-09 Thread R. David Murray

R. David Murray added the comment:

In python3, u"a" and "a" are the same thing.  The equivalent in python3 would 
bee b"a" vs "a", but I have no idea if we even support bytes keys in python3 
gdbm.

In 2.7 does has_key(u"x") work if x is a valid key?

--
nosy: +r.david.murray

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue31398] TypeError: gdbm key must be string, not unicode

2017-09-08 Thread sds

sds added the comment:

the problem is not present in 
Python 3.6.2 (default, Jul 17 2017, 16:44:45):
```
>>> import dbm
>>> import dbm.gnu
>>> db = dbm.gnu.open("foo","c")
>>> "a" in db
False
>>> u"a" in db
False
```

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue31398] TypeError: gdbm key must be string, not unicode

2017-09-08 Thread sds

New submission from sds:

`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 "", line 1, in 
TypeError: gdbm key must be string, not unicode
```

--
components: Unicode
messages: 301728
nosy: ezio.melotti, haypo, sam-s
priority: normal
severity: normal
status: open
title: TypeError: gdbm key must be string, not unicode
type: behavior
versions: Python 2.7

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue31398] TypeError: gdbm key must be string, not unicode

2017-09-08 Thread sds

sds added the comment:

platform:
Python 2.7.13 (default, Jul 18 2017, 09:17:00) 
[GCC 4.2.1 Compatible Apple LLVM 8.1.0 (clang-802.0.42)] on darwin

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com