This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

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.
History
Date User Action Args
2016-01-28 07:55:38eryksunsetrecipients: + eryksun, paul.moore, vstinner, tim.golden, ezio.melotti, zach.ware, steve.dower, abarry
2016-01-28 07:55:38eryksunsetmessageid: <1453967738.59.0.13864031506.issue26227@psf.upfronthosting.co.za>
2016-01-28 07:55:38eryksunlinkissue26227 messages
2016-01-28 07:55:38eryksuncreate