您好,欢迎来到刀刀网。
搜索
您的当前位置:首页web.py 启动时候出现attributeerror module object has no attribute inet_pton错误

web.py 启动时候出现attributeerror module object has no attribute inet_pton错误

来源:刀刀网


web.py 启动时候出现AttributeError 'module' object has no

attribute 'inet_pton'错误

from http://blog.csdn.net/trbbadboy/article/details/9055953

错误信息如下:[plain] view plaincopyprint?

Traceback (most recent call last):

File \"webpy.py\

app.run()

File \"D:\\Python27\\lib\\site-packages\\web\\application.py\

return wsgi.runwsgi(self.wsgifunc(*middleware))

File \"D:\\Python27\\lib\\site-packages\\web\\wsgi.py\

server_addr = validip(listget(sys.argv, 1, ''))

File \"D:\\Python27\\lib\\site-packages\\web\\net.py\

if validip6addr(ip): return (ip,port)

File \"D:\\Python27\\lib\\site-packages\\web\\net.py\

socket.inet_pton(socket.AF_INET6, address)

AttributeError: 'module' object has no attribute 'inet_pton' Traceback (most recent call last):

File \"webpy.py\

app.run()

File \"D:\\Python27\\lib\\site-packages\\web\\application.py\

return wsgi.runwsgi(self.wsgifunc(*middleware))

File \"D:\\Python27\\lib\\site-packages\\web\\wsgi.py\

server_addr = validip(listget(sys.argv, 1, ''))

File \"D:\\Python27\\lib\\site-packages\\web\\net.py\

if validip6addr(ip): return (ip,port)

File \"D:\\Python27\\lib\\site-packages\\web\\net.py\

socket.inet_pton(socket.AF_INET6, address)

AttributeError: 'module' object has no attribute 'inet_pton'

解决方法,修改Python安装目录下Lib\\site-packages\\web\\net.py文件的第32到第35行为如下内容:[python] view plaincopyprint?

try:

socket.inet_pton(socket.AF_INET6, address)

except:

return False 参考:

https://github.com/webpy/webpy/pull/195#issuecomment-19143945

因篇幅问题不能全部显示,请点此查看更多更全内容

Copyright © 2019- gamedaodao.com 版权所有 湘ICP备2022005869号-6

违法及侵权请联系:TEL:199 18 7713 E-MAIL:2724546146@qq.com

本站由北京市万商天勤律师事务所王兴未律师提供法律服务