[Django] #29803: Django throws 500, when running development server and json request is missing trailing /

5 views
Skip to first unread message

Django

unread,
Sep 28, 2018, 1:54:46 PM9/28/18
to django-...@googlegroups.com
#29803: Django throws 500, when running development server and json request is
missing trailing /
-------------------------------------+-------------------------------------
Reporter: | Owner: nobody
pzeinlinger |
Type: Bug | Status: new
Component: Core | Version: 2.1
(Management commands) |
Severity: Normal | Keywords:
Triage Stage: | Has patch: 0
Unreviewed |
Needs documentation: 0 | Needs tests: 0
Patch needs improvement: 0 | Easy pickings: 0
UI/UX: 0 |
-------------------------------------+-------------------------------------
Discovered today after switching to python:3.7 base image from
python:3.7-alpine. When sending an application/json request to a correct
URL with a missing trailing slash, I get a 500 back.
Traceback:
django_1 | Traceback (most recent call last):
django_1 | File "/usr/local/lib/python3.7/site-
packages/django/contrib/staticfiles/handlers.py", line 65, in __call__
django_1 | return self.application(environ, start_response)
django_1 | File "/usr/local/lib/python3.7/site-
packages/django/core/handlers/wsgi.py", line 142, in __call__
django_1 | response = self.get_response(request)
django_1 | File "/usr/local/lib/python3.7/site-
packages/django/core/handlers/base.py", line 78, in get_response
django_1 | response = self._middleware_chain(request)
django_1 | File "/usr/local/lib/python3.7/site-
packages/django/core/handlers/exception.py", line 36, in inner
django_1 | response = response_for_exception(request, exc)
django_1 | File "/usr/local/lib/python3.7/site-
packages/django/core/handlers/exception.py", line 90, in
response_for_exception
django_1 | response = handle_uncaught_exception(request,
get_resolver(get_urlconf()), sys.exc_info())
django_1 | File "/usr/local/lib/python3.7/site-
packages/django/core/handlers/exception.py", line 125, in
handle_uncaught_exception
django_1 | return debug.technical_500_response(request, *exc_info)
django_1 | File "/usr/local/lib/python3.7/site-
packages/django_extensions/management/technical_response.py", line 31, in
null_technical_500_response
django_1 | elif tld.wsgi_tb:
django_1 | AttributeError: '_thread._local' object has no attribute
'wsgi_tb'

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

Django

unread,
Sep 28, 2018, 2:40:03 PM9/28/18
to django-...@googlegroups.com
#29803: Django throws 500, when running development server and json request is
missing trailing /
-------------------------------------+-------------------------------------
Reporter: Paul Zeinlinger | Owner: nobody
Type: Bug | Status: closed
Component: Core (Management | Version: 2.1
commands) |
Severity: Normal | Resolution: invalid
Keywords: | Triage Stage:
| Unreviewed
Has patch: 0 | Needs documentation: 0

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

* status: new => closed
* resolution: => invalid


Old description:

New description:

Discovered today after switching to python:3.7 base image from
python:3.7-alpine. When sending an application/json request to a correct
URL with a missing trailing slash, I get a 500 back.
Traceback:

{{{


Traceback (most recent call last):

File "/usr/local/lib/python3.7/site-
packages/django/contrib/staticfiles/handlers.py", line 65, in __call__

return self.application(environ, start_response)


File "/usr/local/lib/python3.7/site-
packages/django/core/handlers/wsgi.py", line 142, in __call__

response = self.get_response(request)


File "/usr/local/lib/python3.7/site-
packages/django/core/handlers/base.py", line 78, in get_response

response = self._middleware_chain(request)


File "/usr/local/lib/python3.7/site-
packages/django/core/handlers/exception.py", line 36, in inner

response = response_for_exception(request, exc)


File "/usr/local/lib/python3.7/site-
packages/django/core/handlers/exception.py", line 90, in
response_for_exception

response = handle_uncaught_exception(request,
get_resolver(get_urlconf()), sys.exc_info())

File "/usr/local/lib/python3.7/site-
packages/django/core/handlers/exception.py", line 125, in
handle_uncaught_exception

return debug.technical_500_response(request, *exc_info)


File "/usr/local/lib/python3.7/site-
packages/django_extensions/management/technical_response.py", line 31, in
null_technical_500_response

elif tld.wsgi_tb:


AttributeError: '_thread._local' object has no attribute 'wsgi_tb'
}}}

--

Comment:

The crash is in `django_extensions/management/technical_response.py` which
is third party package.

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

Reply all
Reply to author
Forward
0 new messages