Skip to content
Django LiveServerTestCase Windows XP / Selenium / static files / link bug
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Failed to load latest commit information.

This Gist is just a minimal repro of a bug (I think) in Django's LiveServerTestCase, on Windows.

Once a site has some static files (eg CSS), then clicking on a link produces an ugly uncaught exception from the LiveServer thread, like this:

Exception happened during processing of request from ('', 1925)
Traceback (most recent call last):
  File "c:\Python33\lib\site-packages\django\test\", line 1035, in _handle_request_noblock
    self.process_request(request, client_address)
  File "c:\Python33\lib\", line 332, in process_request
    self.finish_request(request, client_address)
  File "c:\Python33\lib\", line 345, in finish_request
    self.RequestHandlerClass(request, client_address, self)
  File "c:\Python33\lib\site-packages\django\core\servers\", line 126
, in __init__
    super(WSGIRequestHandler, self).__init__(*args, **kwargs)
  File "c:\Python33\lib\", line 666, in __init__
  File "c:\Python33\lib\wsgiref\", line 118, in handle
    self.raw_requestline = self.rfile.readline()
  File "c:\Python33\lib\", line 297, in readinto
    return self._sock.recv_into(b)
ConnectionResetError: [WinError 10054] An existing connection was forcibly closed by the remote host

to repro, just run python test

dependencies: selenium.

bug observed on Windows XP. Also reported on Windows 7. doesn't happen on linux.

Something went wrong with that request. Please try again.