加载localhos时Django nonrl中出现断管错误

2024-04-27 04:57:04 发布

您现在位置:Python中文网/ 问答频道 /正文

运行Django nonrl,使用googleappengine 2.6.0和python2.7,当我第一次尝试加载localhost和localhost/admin时,会遇到这个异常(不过,我希望任何页面都会发生这种情况):

Exception happened during processing of request from ('127.0.0.1', 57011)
    Traceback (most recent call last):
      File "/usr/lib/python2.7/SocketServer.py", line 284, in _handle_request_noblock
        self.process_request(request, client_address)
      File "/usr/lib/python2.7/SocketServer.py", line 310, in process_request
        self.finish_request(request, client_address)
      File "/usr/lib/python2.7/SocketServer.py", line 323, in finish_request
        self.RequestHandlerClass(request, client_address, self)
      File "/usr/local/google_appengine/google/appengine/tools/dev_appserver.py", line 2438, in __init__
        BaseHTTPServer.BaseHTTPRequestHandler.__init__(self, *args, **kwargs)
      File "/usr/lib/python2.7/SocketServer.py", line 641, in __init__
        self.finish()
      File "/usr/lib/python2.7/SocketServer.py", line 694, in finish
        self.wfile.flush()
      File "/usr/lib/python2.7/socket.py", line 303, in flush
        self._sock.sendall(view[write_offset:write_offset+buffer_size])
    error: [Errno 32] Broken pipe

奇怪的是,它似乎只使用googlechrome。在使用Firefox时,它不会打印出任何异常(或者至少,在多次尝试之后,我无法在Firefox中复制这个问题)。在

有人知道这个问题吗?。在

谢谢


Tags: inpyselfclientlocalhostinitaddressrequest
1条回答
网友
1楼 · 发布于 2024-04-27 04:57:04

Chrome和dev之间存在着a fewsimilarreports的竞争条件问题_应用服务器.py. 通常的情况是Chrome会打开多个到服务器的并发连接,但会先在第二个连接上发送一个请求。因为dev_appserver是单线程的,第一个请求会阻塞,服务器会挂起,直到有人放弃。在

假设用 disable-preconnect启动Chrome可以防止这种情况。在

相关问题 更多 >