[Django] #31594: Add get_response_async for ASGIStaticFilesHandlerMixin

10 views
Skip to first unread message

Django

unread,
May 15, 2020, 5:41:46 PM5/15/20
to django-...@googlegroups.com
#31594: Add get_response_async for ASGIStaticFilesHandlerMixin
-------------------------------------------+------------------------
Reporter: Joshua Massover | Owner: nobody
Type: Bug | Status: new
Component: Uncategorized | Version: 3.0
Severity: Normal | Keywords:
Triage Stage: Unreviewed | Has patch: 1
Needs documentation: 0 | Needs tests: 0
Patch needs improvement: 0 | Easy pickings: 0
UI/UX: 0 |
-------------------------------------------+------------------------
It looks like the StaticFilesHandlerMixin is missing the the async
response function.

Without this, when trying to use the ASGIStaticFilesHandler, this is the
traceback:

{{{#!python
Exception inside application: 'NoneType' object is not callable
Traceback (most recent call last):
File ".../lib/python3.7/site-packages/daphne/cli.py", line 30, in asgi
await self.app(scope, receive, send)
File ".../src/django/django/contrib/staticfiles/handlers.py", line 86,
in __call__
return await super().__call__(scope, receive, send)
File ".../src/django/django/core/handlers/asgi.py", line 161, in
__call__
response = await self.get_response_async(request)
File ".../src/django/django/core/handlers/base.py", line 148, in
get_response_async
response = await self._middleware_chain(request)
TypeError: 'NoneType' object is not callable
}}}

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

Django

unread,
May 15, 2020, 5:42:43 PM5/15/20
to django-...@googlegroups.com
#31594: Add get_response_async for ASGIStaticFilesHandler
---------------------------------+--------------------------------------

Reporter: Joshua Massover | Owner: nobody
Type: Bug | Status: new
Component: Uncategorized | Version: 3.0
Severity: Normal | Resolution:

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

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

Django

unread,
May 15, 2020, 6:21:05 PM5/15/20
to django-...@googlegroups.com
#31594: Add get_response_async for ASGIStaticFilesHandler
---------------------------------+------------------------------------
Reporter: Joshua Massover | Owner: nobody
Type: Bug | Status: new
Component: Uncategorized | Version: 3.0
Severity: Normal | Resolution:
Keywords: | Triage Stage: Accepted

Has patch: 1 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 1

Easy pickings: 0 | UI/UX: 0
---------------------------------+------------------------------------
Changes (by Simon Charette):

* needs_better_patch: 0 => 1
* stage: Unreviewed => Accepted


Comment:

Left comments on the PR regarding the fact the we don't have a way of
serving files asynchronously so far. From what I know local file I/O
requires some form of thread pooling to work correctly.

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

Django

unread,
Jun 4, 2020, 5:11:41 AM6/4/20
to django-...@googlegroups.com
#31594: Add get_response_async for ASGIStaticFilesHandler
---------------------------------+------------------------------------
Reporter: Joshua Massover | Owner: nobody
Type: Bug | Status: new
Component: Uncategorized | Version: 3.0
Severity: Normal | Resolution:
Keywords: | Triage Stage: Accepted
Has patch: 1 | Needs documentation: 0
Needs tests: 1 | Patch needs improvement: 0

Easy pickings: 0 | UI/UX: 0
---------------------------------+------------------------------------
Changes (by Carlton Gibson):

* needs_better_patch: 1 => 0
* needs_tests: 0 => 1


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

Django

unread,
Jun 8, 2020, 6:34:30 AM6/8/20
to django-...@googlegroups.com
#31594: Add get_response_async for ASGIStaticFilesHandler
-------------------------------------+-------------------------------------
Reporter: Joshua Massover | Owner: Joshua
| Massover
Type: Bug | Status: assigned
Component: contrib.staticfiles | Version: 3.1
Severity: Normal | Resolution:
Keywords: | Triage Stage: Ready for
| checkin

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

* status: new => assigned
* component: Uncategorized => contrib.staticfiles
* needs_tests: 1 => 0
* version: 3.0 => 3.1
* owner: nobody => Joshua Massover
* stage: Accepted => Ready for checkin


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

Django

unread,
Jun 8, 2020, 7:13:26 AM6/8/20
to django-...@googlegroups.com
#31594: Add get_response_async for ASGIStaticFilesHandler
-------------------------------------+-------------------------------------
Reporter: Joshua Massover | Owner: Joshua
| Massover
Type: Bug | Status: closed
Component: contrib.staticfiles | Version: 3.1
Severity: Normal | Resolution: fixed

Keywords: | Triage Stage: Ready for
| checkin
Has patch: 1 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------
Changes (by Mariusz Felisiak <felisiak.mariusz@…>):

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


Comment:

In [changeset:"92309e53d9921a60e667656d8dd65e59eb5cf81c" 92309e53]:
{{{
#!CommitTicketReference repository=""
revision="92309e53d9921a60e667656d8dd65e59eb5cf81c"
Fixed #31594 -- Added ASGIStaticFilesHandler.get_response_async().
}}}

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

Django

unread,
Jun 8, 2020, 7:13:33 AM6/8/20
to django-...@googlegroups.com
#31594: Add get_response_async for ASGIStaticFilesHandler
-------------------------------------+-------------------------------------
Reporter: Joshua Massover | Owner: Joshua
| Massover
Type: Bug | Status: closed
Component: contrib.staticfiles | Version: 3.1
Severity: Normal | Resolution: fixed
Keywords: | Triage Stage: Ready for
| checkin
Has patch: 1 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------

Comment (by Mariusz Felisiak <felisiak.mariusz@…>):

In [changeset:"3fb69756eac31a07d903cf1f97fc1cce0d3494a5" 3fb69756]:
{{{
#!CommitTicketReference repository=""
revision="3fb69756eac31a07d903cf1f97fc1cce0d3494a5"
[3.1.x] Fixed #31594 -- Added ASGIStaticFilesHandler.get_response_async().

Backport of 92309e53d9921a60e667656d8dd65e59eb5cf81c from master
}}}

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

Reply all
Reply to author
Forward
0 new messages