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 spaun2002
Recipients amaury.forgeotdarc, baikie, ezio.melotti, jesterKing, lemburg, loewis, r.david.murray, spaun2002, vstinner
Date 2012-04-12.21:52:13
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <>
Originally I tried 3.2.2 (32bit), but I've just checked 3.2.3 and got the same.
A code for reproduce is simple:

from socket import gethostbyaddr
a = gethostbyaddr('')

leads to:
Traceback (most recent call last):
  File "C:\Users\user\test\", line 13, in <module>
    a = gethostbyaddr('')
UnicodeDecodeError: 'utf-8' codec can't decode byte 0xcf in position 5: invalid continuation byte

Or more complex sample:

def main():
    import http.server
    port = 80
    handlerClass = http.server.SimpleHTTPRequestHandler
    srv = http.server.HTTPServer(("", port), handlerClass )
if __name__ == "__main__":

Attempt of connection to the server leads to:

Exception happened during processing of request from ('', 1156)
Traceback (most recent call last):
  File "C:\Python32\lib\", line 284, in _handle_request_noblock
    self.process_request(request, client_address)
  File "C:\Python32\lib\", line 310, in process_request
    self.finish_request(request, client_address)
  File "C:\Python32\lib\", line 323, in finish_request
    self.RequestHandlerClass(request, client_address, self)
  File "C:\Python32\lib\", line 637, in __init__
  File "C:\Python32\lib\http\", line 396, in handle
  File "C:\Python32\lib\http\", line 384, in handle_one_request
  File "C:\Python32\lib\http\", line 657, in do_GET
    f = self.send_head()
  File "C:\Python32\lib\http\", line 701, in send_head
  File "C:\Python32\lib\http\", line 438, in send_response
  File "C:\Python32\lib\http\", line 483, in log_request
    self.requestline, str(code), str(size))
  File "C:\Python32\lib\http\", line 517, in log_message
  File "C:\Python32\lib\http\", line 559, in address_string
    return socket.getfqdn(host)
  File "C:\Python32\lib\", line 355, in getfqdn
    hostname, aliases, ipaddrs = gethostbyaddr(name)
UnicodeDecodeError: 'utf-8' codec can't decode byte 0xcf in position 5: invalid continuation byte

P.S. My PC name is "USER-ПК"
Date User Action Args
2012-04-12 21:52:14spaun2002setrecipients: + spaun2002, lemburg, loewis, amaury.forgeotdarc, vstinner, baikie, ezio.melotti, r.david.murray, jesterKing
2012-04-12 21:52:14spaun2002setmessageid: <>
2012-04-12 21:52:13spaun2002linkissue9377 messages
2012-04-12 21:52:13spaun2002create