Message371660
I prove my point that the decoding to string is arbitrary:
```
>>> import re
>>> orig_name = "Ř"
>>> orig_ch = orig_name.encode("cp1250") # Because why not?
>>> name = list(re.match(b"(?P<" + orig_ch + b">)", b"").groupdict().keys())[0]
>>> name == orig_name
False
>>> name
'Ø'
>>> name.encode("latin-1") == orig_ch
True
```
For any dynamically-constructed bytes regex pattern, a string group name as output is unusable. Only after latin-1-reencoding can it be safely compared. This latin-1 choice is arbitrary. |
|
Date |
User |
Action |
Args |
2020-06-16 14:34:12 | matpi | set | recipients:
+ matpi, malin |
2020-06-16 14:34:12 | matpi | set | messageid: <1592318052.88.0.70549465929.issue40980@roundup.psfhosted.org> |
2020-06-16 14:34:12 | matpi | link | issue40980 messages |
2020-06-16 14:34:12 | matpi | create | |
|