[Django] #28034: Error when running tests in "Writing your first patch for Django" tutorial.

16 views
Skip to first unread message

Django

unread,
Apr 6, 2017, 5:15:38 AM4/6/17
to django-...@googlegroups.com
#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.

Django

unread,
Apr 6, 2017, 7:25:49 AM4/6/17
to django-...@googlegroups.com
#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 | Resolution:

Keywords: | Triage Stage: Unreviewed
Has patch: 0 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-----------------------------------+--------------------------------------

Comment (by Matteo Parrucci):

The specific test you mention did not fail for me but I have something
more than "a couple" tests failing:

FAILED (failures=37, errors=946, skipped=574, expected failures=6)

But may be it's ok after all

Using python 3.5.2 on Linux mint 18

--
Ticket URL: <https://code.djangoproject.com/ticket/28034#comment:1>

Django

unread,
Apr 6, 2017, 11:06:42 AM4/6/17
to django-...@googlegroups.com
#28034: Update the contributing tutorial to use a more recent patch
--------------------------------------+------------------------------------

Reporter: Mateusz Jankowski | Owner: nobody
Type: Cleanup/optimization | Status: new
Component: Documentation | Version: master
Severity: Normal | Resolution:
Keywords: | Triage Stage: Accepted

Has patch: 0 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
--------------------------------------+------------------------------------
Changes (by Tim Graham):

* type: Uncategorized => Cleanup/optimization
* stage: Unreviewed => Accepted


Comment:

That point in Django's history doesn't have the Python 3.6 compatibility
fixes. We should update the tutorial to use a more recent commit (this was
last done in 3fd754f12df42d173b6e9a93e7c32f8f5be55e7f).
0034e9af18f3d393a6dd2389ffbba4c919b1d7d7 could be a candidate patch to use
for the tutorial.

--
Ticket URL: <https://code.djangoproject.com/ticket/28034#comment:2>

Django

unread,
Aug 19, 2017, 3:54:11 PM8/19/17
to django-...@googlegroups.com
#28034: Update the contributing tutorial to use a more recent patch
-------------------------------------+-------------------------------------
Reporter: Mateusz Jankowski | Owner: Joe
Type: | Krzystan
Cleanup/optimization | Status: assigned
Component: Documentation | Version: master

Severity: Normal | Resolution:
Keywords: | Triage Stage: Accepted
Has patch: 0 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------
Changes (by Joe Krzystan):

* owner: nobody => Joe Krzystan
* status: new => assigned


--
Ticket URL: <https://code.djangoproject.com/ticket/28034#comment:3>

Django

unread,
Aug 25, 2017, 1:04:40 AM8/25/17
to django-...@googlegroups.com
#28034: Update the contributing tutorial to use a more recent patch
-------------------------------------+-------------------------------------
Reporter: Mateusz Jankowski | Owner: Joe
Type: | Krzystan
Cleanup/optimization | Status: assigned
Component: Documentation | Version: master

Severity: Normal | Resolution:
Keywords: | Triage Stage: Accepted
Has patch: 1 | Needs documentation: 0

Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------
Changes (by Joe Krzystan):

* has_patch: 0 => 1


Comment:

Submitted PR with updates per #5851
(0034e9af18f3d393a6dd2389ffbba4c919b1d7d7).

https://github.com/django/django/pull/8970

--
Ticket URL: <https://code.djangoproject.com/ticket/28034#comment:4>

Django

unread,
Aug 26, 2017, 9:13:01 PM8/26/17
to django-...@googlegroups.com
#28034: Update the contributing tutorial to use a more recent patch
-------------------------------------+-------------------------------------
Reporter: Mateusz Jankowski | Owner: Joe
Type: | Krzystan
Cleanup/optimization | Status: assigned
Component: Documentation | Version: master

Severity: Normal | Resolution:
Keywords: | Triage Stage: Accepted
Has patch: 1 | Needs documentation: 0

Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------

Comment (by Tim Graham):

At this point, it would be idea to use a more recent patch that doesn't
require an old version of Sphinx to build the documentation. I'm beginning
to wonder if there might be a better approach to this tutorial so that we
don't have to update it every so often.

--
Ticket URL: <https://code.djangoproject.com/ticket/28034#comment:5>

Django

unread,
Sep 6, 2017, 7:09:30 PM9/6/17
to django-...@googlegroups.com
#28034: Update the contributing tutorial to use a more recent patch
-------------------------------------+-------------------------------------
Reporter: Mateusz Jankowski | Owner: Joe
Type: | Krzystan
Cleanup/optimization | Status: assigned
Component: Documentation | Version: master

Severity: Normal | Resolution:
Keywords: | Triage Stage: Accepted
Has patch: 0 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------
Changes (by Tim Graham):

* has_patch: 1 => 0


Comment:

I merged 407c1249c9a0296ec8a8d95e447bd695ca471b5e today. That could be a
candidate to use.

--
Ticket URL: <https://code.djangoproject.com/ticket/28034#comment:6>

Django

unread,
Sep 11, 2018, 4:47:34 PM9/11/18
to django-...@googlegroups.com
#28034: Update the contributing tutorial to use a more recent patch
-------------------------------------+-------------------------------------
Reporter: Mateusz Jankowski | Owner: Joe
Type: | Krzystan
Cleanup/optimization | Status: assigned
Component: Documentation | Version: master

Severity: Normal | Resolution:
Keywords: | Triage Stage: Accepted
Has patch: 0 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------
Changes (by Adam (Chainz) Johnson):

* cc: Adam (Chainz) Johnson (added)


--
Ticket URL: <https://code.djangoproject.com/ticket/28034#comment:7>

Django

unread,
Oct 2, 2018, 2:21:00 PM10/2/18
to django-...@googlegroups.com
#28034: Update the contributing tutorial to use a more recent patch
-------------------------------------+-------------------------------------
Reporter: Mateusz Jankowski | Owner: Joe
Type: | Krzystan
Cleanup/optimization | Status: assigned
Component: Documentation | Version: master

Severity: Normal | Resolution:
Keywords: | Triage Stage: Accepted
Has patch: 1 | Needs documentation: 0

Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------
Changes (by Tim Graham):

* has_patch: 0 => 1


Comment:

[https://github.com/django/django/pull/10418 PR]

--
Ticket URL: <https://code.djangoproject.com/ticket/28034#comment:8>

Django

unread,
Oct 3, 2018, 3:09:49 PM10/3/18
to django-...@googlegroups.com
#28034: Update the contributing tutorial to use a more recent patch
-------------------------------------+-------------------------------------
Reporter: Mateusz Jankowski | Owner: Joe
Type: | Krzystan
Cleanup/optimization | Status: closed
Component: Documentation | Version: master
Severity: Normal | Resolution: fixed
Keywords: | Triage Stage: Accepted
Has patch: 1 | Needs documentation: 0

Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------
Changes (by Tim Graham <timograham@…>):

* status: assigned => closed
* resolution: => fixed


Comment:

In [changeset:"18e4ade79ef145401b899ab539322c95d2a64266" 18e4ade7]:
{{{
#!CommitTicketReference repository=""
revision="18e4ade79ef145401b899ab539322c95d2a64266"
Fixed #28034 -- Updated the contributing tutorial to use an imaginary
ticket.
}}}

--
Ticket URL: <https://code.djangoproject.com/ticket/28034#comment:9>

Django

unread,
Oct 3, 2018, 3:10:13 PM10/3/18
to django-...@googlegroups.com
#28034: Update the contributing tutorial to use a more recent patch
-------------------------------------+-------------------------------------
Reporter: Mateusz Jankowski | Owner: Joe
Type: | Krzystan
Cleanup/optimization | Status: closed
Component: Documentation | Version: master

Severity: Normal | Resolution: fixed
Keywords: | Triage Stage: Accepted
Has patch: 1 | Needs documentation: 0

Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------

Comment (by Tim Graham <timograham@…>):

In [changeset:"173e242d715da1eedce2540f8531b9c446177a16" 173e242d]:
{{{
#!CommitTicketReference repository=""
revision="173e242d715da1eedce2540f8531b9c446177a16"
[2.1.x] Fixed #28034 -- Updated the contributing tutorial to use an
imaginary ticket.

Backport of 18e4ade79ef145401b899ab539322c95d2a64266 from master.
}}}

--
Ticket URL: <https://code.djangoproject.com/ticket/28034#comment:10>

Django

unread,
Apr 23, 2021, 9:24:59 AM4/23/21
to django-...@googlegroups.com
#28034: Update the contributing tutorial to use a more recent patch
-------------------------------------+-------------------------------------
Reporter: Mateusz Jankowski | Owner: Joe
Type: | Krzystan
Cleanup/optimization | Status: closed
Component: Documentation | Version: dev

Severity: Normal | Resolution: fixed
Keywords: | Triage Stage: Accepted
Has patch: 1 | Needs documentation: 0

Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------

Comment (by GitHub <noreply@…>):

In [changeset:"67bb1f516cf507feb141fd4ef746456e1ef67c4a" 67bb1f51]:
{{{
#!CommitTicketReference repository=""
revision="67bb1f516cf507feb141fd4ef746456e1ef67c4a"
Refs #28034 -- Corrected docs example in contributing tutorial.
}}}

--
Ticket URL: <https://code.djangoproject.com/ticket/28034#comment:11>

Django

unread,
Apr 23, 2021, 9:25:45 AM4/23/21
to django-...@googlegroups.com
#28034: Update the contributing tutorial to use a more recent patch
-------------------------------------+-------------------------------------
Reporter: Mateusz Jankowski | Owner: Joe
Type: | Krzystan
Cleanup/optimization | Status: closed
Component: Documentation | Version: dev
Severity: Normal | Resolution: fixed
Keywords: | Triage Stage: Accepted
Has patch: 1 | Needs documentation: 0

Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------

Comment (by Carlton Gibson <carlton.gibson@…>):

In [changeset:"fc9cbad880632e77a37957ba6686a72c2e7481e4" fc9cbad]:
{{{
#!CommitTicketReference repository=""
revision="fc9cbad880632e77a37957ba6686a72c2e7481e4"
[3.2.x] Refs #28034 -- Corrected docs example in contributing tutorial.

Backport of 67bb1f516cf507feb141fd4ef746456e1ef67c4a from main
}}}

--
Ticket URL: <https://code.djangoproject.com/ticket/28034#comment:12>

Reply all
Reply to author
Forward
0 new messages