Index: Lib/BaseHTTPServer.py =================================================================== RCS file: /cvsroot/python/python/dist/src/Lib/BaseHTTPServer.py,v retrieving revision 1.10 diff -c -r1.10 BaseHTTPServer.py *** Lib/BaseHTTPServer.py 2000年05月09日 14:54:13 1.10 --- Lib/BaseHTTPServer.py 2000年08月16日 16:09:55 *************** *** 93,111 **** """Override server_bind to store the server name.""" SocketServer.TCPServer.server_bind(self) host, port = self.socket.getsockname() ! if not host or host == '0.0.0.0': ! host = socket.gethostname() ! try: ! hostname, hostnames, hostaddrs = socket.gethostbyaddr(host) ! except socket.error: ! hostname = host else: ! if '.' not in hostname: ! for host in hostnames: ! if '.' in host: ! hostname = host ! break ! self.server_name = hostname self.server_port = port --- 93,104 ---- """Override server_bind to store the server name.""" SocketServer.TCPServer.server_bind(self) host, port = self.socket.getsockname() ! if host == '0.0.0.0': ! # local host ! host = socket.getfqdn() else: ! host = socket.getfqdn(host) ! self.server_name = host self.server_port = port *************** *** 417,433 **** and tries to find a name that contains at least one dot. """ - - (host, port) = self.client_address - try: - name, names, addresses = socket.gethostbyaddr(host) - except socket.error, msg: - return host - names.insert(0, name) - for name in names: - if '.' in name: return name - return names[0] # Essentially static class variables --- 410,418 ---- and tries to find a name that contains at least one dot. """ + host, port = self.client_address + return socket.getfqdn(host) # Essentially static class variables Index: Lib/ftplib.py =================================================================== RCS file: /cvsroot/python/python/dist/src/Lib/ftplib.py,v retrieving revision 1.42 diff -c -r1.42 ftplib.py *** Lib/ftplib.py 2000年03月28日 21:45:45 1.42 --- Lib/ftplib.py 2000年08月16日 16:09:55 *************** *** 41,47 **** # Import SOCKS module if it exists, else standard socket module socket try: ! import SOCKS; socket = SOCKS except ImportError: import socket --- 41,48 ---- # Import SOCKS module if it exists, else standard socket module socket try: ! import SOCKS; socket = SOCKS; del SOCKS # import SOCKS as socket ! from socket import getfqdn; socket.getfqdn = getfqdn; del getfqdn except ImportError: import socket *************** *** 291,307 **** if not passwd: passwd = '' if not acct: acct = '' if user == 'anonymous' and passwd in ('', '-'): ! thishost = socket.gethostname() ! # Make sure it is fully qualified ! if not '.' in thishost: ! thisaddr = socket.gethostbyname(thishost) ! firstname, names, unused = \ ! socket.gethostbyaddr(thisaddr) ! names.insert(0, firstname) ! for name in names: ! if '.' in name: ! thishost = name ! break try: if os.environ.has_key('LOGNAME'): realuser = os.environ['LOGNAME'] --- 292,299 ---- if not passwd: passwd = '' if not acct: acct = '' if user == 'anonymous' and passwd in ('', '-'): ! # get fully qualified domain name of local host ! thishost = socket.getfqdn() try: if os.environ.has_key('LOGNAME'): realuser = os.environ['LOGNAME'] Index: Lib/socket.py =================================================================== RCS file: /cvsroot/python/python/dist/src/Lib/socket.py,v retrieving revision 1.1 diff -c -r1.1 socket.py *** Lib/socket.py 2000年08月16日 14:14:31 1.1 --- Lib/socket.py 2000年08月16日 16:09:57 *************** *** 85,91 **** is returned. """ name = name.strip() ! if len(name) == 0: name = gethostname() try: hostname, aliases, ipaddrs = gethostbyaddr(name) --- 85,91 ---- is returned. """ name = name.strip() ! if not name: name = gethostname() try: hostname, aliases, ipaddrs = gethostbyaddr(name)