#28034: Error when running tests in "Writing your first patch for Django" 
tutorial.
---------------------------------------------+------------------------
               Reporter:  Mateusz Jankowski  |          Owner:  nobody
                   Type:  Uncategorized      |         Status:  new
              Component:  Documentation      |        Version:  master
               Severity:  Normal             |       Keywords:
           Triage Stage:  Unreviewed         |      Has patch:  0
    Needs documentation:  0                  |    Needs tests:  0
Patch needs improvement:  0                  |  Easy pickings:  0
                  UI/UX:  0                  |
---------------------------------------------+------------------------
 I have started going through
 https://docs.djangoproject.com/en/dev/intro/contributing/. As advised in
 https://docs.djangoproject.com/en/dev/intro/contributing/#rolling-back-
 to-a-previous-revision-of-django I go back to commit
 4ccfc4439a7add24f8db4ef3960d02ef8ae09887 (from 26 May 2015). I run the
 tests and some are failing. I ignore this as of "If you’re using Python
 3.5+, there will be a couple failures related to deprecation warnings that
 you can ignore. These failures have since been fixed in Django." in
 https://docs.djangoproject.com/en/dev/intro/contributing/#running-django-s
 -test-suite-for-the-first-time. But I also get one error in
 
{{{servers.test_basehttp.WSGIRequestHandlerTestCase.test_strips_underscore_headers}}}.

 I'm running Python 3.6.1 on MacOS Sierra 10.12.2.

 Traceback:
 {{{
 (djangodev) django/tests [4ccfc44] » ./runtests.py
 servers.test_basehttp.WSGIRequestHandlerTestCase.test_strips_underscore_headers
 Testing against Django installed in
 '/Users/mateuszjankowski/Code/django/django'
 Creating test database for alias 'default'...
 Creating test database for alias 'other'...
 E
 ======================================================================
 ERROR: test_strips_underscore_headers
 (servers.test_basehttp.WSGIRequestHandlerTestCase)
 WSGIRequestHandler ignores headers containing underscores.
 ----------------------------------------------------------------------
 Traceback (most recent call last):
   File
 
"/usr/local/Cellar/python3/3.6.1/Frameworks/Python.framework/Versions/3.6/lib/python3.6/wsgiref/handlers.py",
 line 138, in run
     self.finish_response()
   File
 
"/usr/local/Cellar/python3/3.6.1/Frameworks/Python.framework/Versions/3.6/lib/python3.6/wsgiref/handlers.py",
 line 180, in finish_response
     self.write(data)
   File
 
"/usr/local/Cellar/python3/3.6.1/Frameworks/Python.framework/Versions/3.6/lib/python3.6/wsgiref/handlers.py",
 line 274, in write
     self.send_headers()
   File
 
"/usr/local/Cellar/python3/3.6.1/Frameworks/Python.framework/Versions/3.6/lib/python3.6/wsgiref/handlers.py",
 line 332, in send_headers
     self.send_preamble()
   File
 
"/usr/local/Cellar/python3/3.6.1/Frameworks/Python.framework/Versions/3.6/lib/python3.6/wsgiref/handlers.py",
 line 252, in send_preamble
     self._write(('HTTP/%s %s\r\n' %
 (self.http_version,self.status)).encode('iso-8859-1'))
   File
 
"/usr/local/Cellar/python3/3.6.1/Frameworks/Python.framework/Versions/3.6/lib/python3.6/wsgiref/handlers.py",
 line 453, in _write
     result = self.stdout.write(data)
   File
 
"/usr/local/Cellar/python3/3.6.1/Frameworks/Python.framework/Versions/3.6/lib/python3.6/socketserver.py",
 line 775, in write
     self._sock.sendall(b)
 AttributeError: 'Stub' object has no attribute 'sendall'

 During handling of the above exception, another exception occurred:

 Traceback (most recent call last):
   File
 
"/usr/local/Cellar/python3/3.6.1/Frameworks/Python.framework/Versions/3.6/lib/python3.6/wsgiref/handlers.py",
 line 141, in run
     self.handle_error()
   File
 "/Users/mateuszjankowski/Code/django/django/core/servers/basehttp.py",
 line 92, in handle_error
     super(ServerHandler, self).handle_error()
   File
 
"/usr/local/Cellar/python3/3.6.1/Frameworks/Python.framework/Versions/3.6/lib/python3.6/wsgiref/handlers.py",
 line 368, in handle_error
     self.finish_response()
   File
 
"/usr/local/Cellar/python3/3.6.1/Frameworks/Python.framework/Versions/3.6/lib/python3.6/wsgiref/handlers.py",
 line 180, in finish_response
     self.write(data)
   File
 
"/usr/local/Cellar/python3/3.6.1/Frameworks/Python.framework/Versions/3.6/lib/python3.6/wsgiref/handlers.py",
 line 274, in write
     self.send_headers()
   File
 
"/usr/local/Cellar/python3/3.6.1/Frameworks/Python.framework/Versions/3.6/lib/python3.6/wsgiref/handlers.py",
 line 331, in send_headers
     if not self.origin_server or self.client_is_modern():
   File
 
"/usr/local/Cellar/python3/3.6.1/Frameworks/Python.framework/Versions/3.6/lib/python3.6/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
 "/Users/mateuszjankowski/Code/django/tests/servers/test_basehttp.py", line
 72, in test_strips_underscore_headers
     WSGIRequestHandler(request, '192.168.0.2', server)
   File
 "/Users/mateuszjankowski/Code/django/django/core/servers/basehttp.py",
 line 99, in __init__
     super(WSGIRequestHandler, self).__init__(*args, **kwargs)
   File
 
"/usr/local/Cellar/python3/3.6.1/Frameworks/Python.framework/Versions/3.6/lib/python3.6/socketserver.py",
 line 696, in __init__
     self.handle()
   File
 "/Users/mateuszjankowski/Code/django/django/core/servers/basehttp.py",
 line 179, in handle
     handler.run(self.server.get_app())
   File
 
"/usr/local/Cellar/python3/3.6.1/Frameworks/Python.framework/Versions/3.6/lib/python3.6/wsgiref/handlers.py",
 line 144, in run
     self.close()
   File
 
"/usr/local/Cellar/python3/3.6.1/Frameworks/Python.framework/Versions/3.6/lib/python3.6/wsgiref/simple_server.py",
 line 35, in close
     self.status.split(' ',1)[0], self.bytes_sent
 AttributeError: 'NoneType' object has no attribute 'split'

 ----------------------------------------------------------------------
 Ran 1 test in 0.002s

 FAILED (errors=1)
 Destroying test database for alias 'default'...
 Destroying test database for alias 'other'...
 }}}

--
Ticket URL: <https://code.djangoproject.com/ticket/28034>
Django <https://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.

-- 
You received this message because you are subscribed to the Google Groups 
"Django updates" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-updates/055.5bea251e106da81043aec5d852b70f41%40djangoproject.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to