Quentin Wenger <[email protected]> added the comment:
And there's no need for a cryptic encoding like cp1250 for this problem to
arise. Here is a simple example with Python's default encoding utf-8:
```
>>> a = "ú"
>>> b = list(re.match(b"(?P<" + a.encode() + b">)", b"").groupdict())[0]
>>> a.isidentifier()
True
>>> b.isidentifier()
True
>>> b
'ú'
>>> a.encode() == b.encode("latin1")
True
```
For reference, here is the very source of the issue:
https://github.com/python/cpython/blob/master/Lib/sre_parse.py#L228
----------
_______________________________________
Python tracker <[email protected]>
<https://bugs.python.org/issue40980>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe:
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com