bug of Python

TurboGear中运行python start-hello.py,错误如下
2007-04-04 22:04:03,977 cherrypy.msg INFO CONFIG: Server parameters:
2007-04-04 22:04:03,977 cherrypy.msg INFO CONFIG:   server.environment: developm ent
2007-04-04 22:04:03,978 cherrypy.msg INFO CONFIG:   server.log_to_screen: True
2007-04-04 22:04:03,978 cherrypy.msg INFO CONFIG:   server.log_file:
2007-04-04 22:04:03,978 cherrypy.msg INFO CONFIG:   server.log_tracebacks: True
2007-04-04 22:04:03,978 cherrypy.msg INFO CONFIG:   server.log_request_headers: True
2007-04-04 22:04:03,979 cherrypy.msg INFO CONFIG:   server.protocol_version: HTT P/1.0
2007-04-04 22:04:03,979 cherrypy.msg INFO CONFIG:   server.socket_host:
2007-04-04 22:04:03,979 cherrypy.msg INFO CONFIG:   server.socket_port: 8080
2007-04-04 22:04:03,979 cherrypy.msg INFO CONFIG:   server.socket_file:
2007-04-04 22:04:03,979 cherrypy.msg INFO CONFIG:   server.reverse_dns: False
2007-04-04 22:04:03,980 cherrypy.msg INFO CONFIG:   server.socket_queue_size: 5
2007-04-04 22:04:03,980 cherrypy.msg INFO CONFIG:   server.thread_pool: 10
Unhandled exception in thread started by <bound method Server._start of <cherryp y._cpserver.Server object at 0xb7c442cc>>
Traceback (most recent call last):
  File "/usr/local/lib/python2.4/site-packages/CherryPy-2.2.1-py2.4.egg/cherrypy /_cpserver.py", line 79, in _start
    self.start_http_server()
  File "/usr/local/lib/python2.4/site-packages/CherryPy-2.2.1-py2.4.egg/cherrypy /_cpserver.py", line 99, in start_http_server
    wait_for_free_port(host, port)
  File "/usr/local/lib/python2.4/site-packages/CherryPy-2.2.1-py2.4.egg/cherrypy /_cpserver.py", line 244, in wait_for_free_port
    check_port(host, port)
  File "/usr/local/lib/python2.4/site-packages/CherryPy-2.2.1-py2.4.egg/cherrypy /_cpserver.py", line 219, in check_port
    socket.SOCK_STREAM):
socket.gaierror: (-2, 'Name or service not known')

sourceforge上发现别人说是python的一个bug,确实,解决它只要在/etc/hosts中加入127.0.0.1 localhost就好,这么个问题郁闷半天,faint


你可能感兴趣的:(python)