Message259106
The patch is missing the "errors" parameter of PyUnicode_DecodeLocale. But it should call PyUnicode_DecodeMBCS instead. In the "C" locale, PyUnicode_DecodeLocale is Latin-1 because the CRT mbstowcs just casts the values to wchar_t.
socket_getnameinfo also decodes as UTF-8:
>>> socket.getnameinfo(('127.0.0.1', 20), 0)
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
UnicodeDecodeError: 'utf-8' codec can't decode byte 0x82 in position 0: invalid start byte
Steve, does your suggestion include reimplementing socket.gethostbyaddr and socket.gethostbyname_ex using GetNameInfoW and GetAddrInfoW? gethostbyaddr and gethostbyname are deprecated and lack a Unicode implementation. |
|
Date |
User |
Action |
Args |
2016-01-28 07:55:38 | eryksun | set | recipients:
+ eryksun, paul.moore, vstinner, tim.golden, ezio.melotti, zach.ware, steve.dower, abarry |
2016-01-28 07:55:38 | eryksun | set | messageid: <1453967738.59.0.13864031506.issue26227@psf.upfronthosting.co.za> |
2016-01-28 07:55:38 | eryksun | link | issue26227 messages |
2016-01-28 07:55:38 | eryksun | create | |
|