AttributeError:“ NoneType”对象仅在Firefox中没有属性“ split”

时间:2019-09-13 20:55:43

标签: python django debugging firefox error-handling

我最近在Django中启动了一个项目,并且在该框架中没有太多经验。但是,到目前为止,一切工作正常,但是在浏览器中打开项目的站点时出现了这些错误。我不确定这是怎么回事,但是我注意到这仅在Firefox中并且仅在导航到项目的任何页面时在新标签页中打开任何其他网站(尤其是Facebook或Gmail)后才发生。在访问这些网站之前,一切正常,控制台中没有任何错误。

如果在此之后清除浏览器的缓存并关闭其他选项卡,则一切恢复正常,直到我重新打开任何网站。

此外,我检查了Chrome是否会出现这种情况,并且我注意到即使在新标签页中打开了提到的网站,一切也都可以正常工作。

有人可以向我提供更多有关这些错误原因的信息吗?

谢谢

Traceback (most recent call last):
  File "C:\Users\Varangian\AppData\Local\Programs\Python\Python37-32\lib\wsgiref\handlers.py", line 138, in run
    self.finish_response()
  File "C:\Users\Varangian\AppData\Local\Programs\Python\Python37-32\lib\wsgiref\handlers.py", line 180, in finish_response
    self.write(data)
  File "C:\Users\Varangian\AppData\Local\Programs\Python\Python37-32\lib\wsgiref\handlers.py", line 274, in write
    self.send_headers()
  File "C:\Users\Varangian\AppData\Local\Programs\Python\Python37-32\lib\wsgiref\handlers.py", line 332, in send_headers
    self.send_preamble()
  File "C:\Users\Varangian\AppData\Local\Programs\Python\Python37-32\lib\wsgiref\handlers.py", line 255, in send_preamble
    ('Date: %s\r\n' % format_date_time(time.time())).encode('iso-8859-1')
  File "C:\Users\Varangian\AppData\Local\Programs\Python\Python37-32\lib\wsgiref\handlers.py", line 453, in _write
    result = self.stdout.write(data)
  File "C:\Users\Varangian\AppData\Local\Programs\Python\Python37-32\lib\socketserver.py", line 799, in write
    self._sock.sendall(b)
ConnectionAbortedError: [WinError 10053] An established connection was aborted by the software in your host machine
[13/Sep/2019 22:40:56] "GET /favicon.ico HTTP/1.1" 500 59
----------------------------------------
Exception happened during processing of request from ('127.0.0.1', 59289)
Traceback (most recent call last):
  File "C:\Users\Varangian\AppData\Local\Programs\Python\Python37-32\lib\wsgiref\handlers.py", line 138, in run
    self.finish_response()
  File "C:\Users\Varangian\AppData\Local\Programs\Python\Python37-32\lib\wsgiref\handlers.py", line 180, in finish_response
    self.write(data)
  File "C:\Users\Varangian\AppData\Local\Programs\Python\Python37-32\lib\wsgiref\handlers.py", line 274, in write
    self.send_headers()
  File "C:\Users\Varangian\AppData\Local\Programs\Python\Python37-32\lib\wsgiref\handlers.py", line 332, in send_headers
    self.send_preamble()
  File "C:\Users\Varangian\AppData\Local\Programs\Python\Python37-32\lib\wsgiref\handlers.py", line 255, in send_preamble
    ('Date: %s\r\n' % format_date_time(time.time())).encode('iso-8859-1')
  File "C:\Users\Varangian\AppData\Local\Programs\Python\Python37-32\lib\wsgiref\handlers.py", line 453, in _write
    result = self.stdout.write(data)
  File "C:\Users\Varangian\AppData\Local\Programs\Python\Python37-32\lib\socketserver.py", line 799, in write
    self._sock.sendall(b)
ConnectionAbortedError: [WinError 10053] An established connection was aborted by the software in your host machine

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "C:\Users\Varangian\AppData\Local\Programs\Python\Python37-32\lib\wsgiref\handlers.py", line 141, in run
    self.handle_error()
  File "C:\Users\Varangian\AppData\Local\Programs\Python\Python37-32\lib\site-packages\django\core\servers\basehttp.py", line 116, in handle_error
    super().handle_error()
  File "C:\Users\Varangian\AppData\Local\Programs\Python\Python37-32\lib\wsgiref\handlers.py", line 368, in handle_error
    self.finish_response()
  File "C:\Users\Varangian\AppData\Local\Programs\Python\Python37-32\lib\wsgiref\handlers.py", line 180, in finish_response
    self.write(data)
  File "C:\Users\Varangian\AppData\Local\Programs\Python\Python37-32\lib\wsgiref\handlers.py", line 274, in write
    self.send_headers()
  File "C:\Users\Varangian\AppData\Local\Programs\Python\Python37-32\lib\wsgiref\handlers.py", line 331, in send_headers
    if not self.origin_server or self.client_is_modern():
  File "C:\Users\Varangian\AppData\Local\Programs\Python\Python37-32\lib\wsgiref\handlers.py", line 344, in client_is_modern
    return self.environ['SERVER_PROTOCOL'].upper() != 'HTTP/0.9'
TypeError: 'NoneType' object is not subscriptable

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "C:\Users\Varangian\AppData\Local\Programs\Python\Python37-32\lib\socketserver.py", line 650, in process_request_thread
    self.finish_request(request, client_address)
  File "C:\Users\Varangian\AppData\Local\Programs\Python\Python37-32\lib\socketserver.py", line 360, in finish_request
    self.RequestHandlerClass(request, client_address, self)
  File "C:\Users\Varangian\AppData\Local\Programs\Python\Python37-32\lib\socketserver.py", line 720, in __init__
    self.handle()
  File "C:\Users\Varangian\AppData\Local\Programs\Python\Python37-32\lib\site-packages\django\core\servers\basehttp.py", line 171, in handle
    self.handle_one_request()
  File "C:\Users\Varangian\AppData\Local\Programs\Python\Python37-32\lib\site-packages\django\core\servers\basehttp.py", line 194, in handle_one_request
    handler.run(self.server.get_app())
  File "C:\Users\Varangian\AppData\Local\Programs\Python\Python37-32\lib\wsgiref\handlers.py", line 144, in run
    self.close()
  File "C:\Users\Varangian\AppData\Local\Programs\Python\Python37-32\lib\site-packages\django\core\servers\basehttp.py", line 111, in close
    super().close()
  File "C:\Users\Varangian\AppData\Local\Programs\Python\Python37-32\lib\wsgiref\simple_server.py", line 35, in close
    self.status.split(' ',1)[0], self.bytes_sent
AttributeError: 'NoneType' object has no attribute 'split'

0 个答案:

没有答案