Message259106
| Author |
eryksun |
| Recipients |
abarry, eryksun, ezio.melotti, paul.moore, steve.dower, tim.golden, vstinner, zach.ware |
| Date |
2016年01月28日.07:55:38 |
| SpamBayes Score |
-1.0 |
| Marked as misclassified |
Yes |
| Message-id |
<1453967738.59.0.13864031506.issue26227@psf.upfronthosting.co.za> |
| In-reply-to |
| Content |
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. |
|