错误
Traceback (most recent call last): File "test.py", line 11, in <module> app.run() File "D:devPython27libsite-packageswebapplication.py", line 313, in run return wsgi.runwsgi(self.wsgifunc(*middleware)) File "D:devPython27libsite-packageswebwsgi.py", line 55, in runwsgi server_addr = validip(listget(sys.argv, 1, '')) File "D:devPython27libsite-packagesweb et.py", line 108, in validip if validip6addr(ip): return (ip,port) File "D:devPython27libsite-packagesweb et.py", line 33, in validip6addr socket.inet_pton(socket.AF_INET6, address) AttributeError: 'module' object has no attribute 'inet_pton'
解决方法,修改D:devPython27Libsite-packagesweb et.py
def validip6addr(address): """ Returns True if `address` is a valid IPv6 address. >>> validip6addr('::') True >>> validip6addr('aaaa:bbbb:cccc:dddd::1') True >>> validip6addr('1:2:3:4:5:6:7:8:9:10') False >>> validip6addr('12:10') False """ """ try: socket.inet_pton(socket.AF_INET6, address) except socket.error: return False """ return False