Index: Lib/BaseHTTPServer.py =================================================================== --- Lib/BaseHTTPServer.py (révision 80469) +++ Lib/BaseHTTPServer.py (copie de travail) @@ -484,16 +484,12 @@ 'Jul', 'Aug', 'Sep', 'Oct', 'Nov', 'Dec'] def address_string(self): - """Return the client address formatted for logging. + """Return the client address formatted for logging.""" + if not hasattr(self, 'client_address_string'): + host, port = self.client_address[:2] + self.client_address_string = socket.getfqdn(host) + return self.client_address_string - This version looks up the full hostname using gethostbyaddr(), - and tries to find a name that contains at least one dot. - - """ - - host, port = self.client_address[:2] - return socket.getfqdn(host) - # Essentially static class variables # The version of the HTTP protocol we support.