[Django] #36951: log_task_finished signal logs "NoneType: None" when no exception is raised

4 views
Skip to first unread message

Django

unread,
Feb 25, 2026, 12:08:33 PM (23 hours ago) Feb 25
to django-...@googlegroups.com
#36951: log_task_finished signal logs "NoneType: None" when no exception is raised
-------------------------------------+-------------------------------------
Reporter: Jacob | Owner: Elias Hernandis
Walls |
Type: Bug | Status: assigned
Component: Tasks | Version: 6.0
Severity: Release | Keywords:
blocker |
Triage Stage: | Has patch: 0
Unreviewed |
Needs documentation: 0 | Needs tests: 0
Patch needs improvement: 0 | Easy pickings: 0
UI/UX: 0 |
-------------------------------------+-------------------------------------
The test provided on #20722 demonstrates that faux exceptions are logged
as `NoneType: None` by the `log_task_finished` signal:

{{{#!py
======================================================================
FAIL: test_successful_task_no_none_type_in_logs
(tasks.test_immediate_backend.ImmediateBackendTestCase.test_successful_task_no_none_type_in_logs)
----------------------------------------------------------------------
Traceback (most recent call last):
File "/Users/jwalls/django/tests/tasks/test_immediate_backend.py", line
238, in test_successful_task_no_none_type_in_logs
self.assertNotIn("NoneType", log_output)
~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^
AssertionError: 'NoneType' unexpectedly found in 'INFO:django.tasks:Task
id=1yKnLbcmTGMEUfj0B1JG0766LDM1Sono path=tasks.tasks.noop_task
state=SUCCESSFUL\nNoneType: None'

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

Django

unread,
Feb 25, 2026, 12:08:55 PM (23 hours ago) Feb 25
to django-...@googlegroups.com
#36951: log_task_finished signal logs "NoneType: None" when no exception is raised
-------------------------------------+-------------------------------------
Reporter: Jacob Walls | Owner: Elias
| Hernandis
Type: Bug | Status: assigned
Component: Tasks | Version: 6.0
Severity: Release blocker | Resolution:
Keywords: | Triage Stage: Ready for
| checkin
Has patch: 0 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------
Changes (by Jacob Walls):

* stage: Unreviewed => Ready for checkin

Comment:

[https://github.com/django/django/pull/20722 PR]
--
Ticket URL: <https://code.djangoproject.com/ticket/36951#comment:1>

Django

unread,
Feb 25, 2026, 12:09:31 PM (23 hours ago) Feb 25
to django-...@googlegroups.com
#36951: log_task_finished signal logs "NoneType: None" when no exception is raised
-------------------------------------+-------------------------------------
Reporter: Jacob Walls | Owner: Elias
| Hernandis
Type: Bug | Status: assigned
Component: Tasks | Version: 6.0
Severity: Release blocker | Resolution:
Keywords: | Triage Stage: Ready for
| checkin
Has patch: 0 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------
Comment (by Jacob Walls):

Opening the ticket as a courtesy, accepting as a triager.
--
Ticket URL: <https://code.djangoproject.com/ticket/36951#comment:2>

Django

unread,
Feb 25, 2026, 12:10:05 PM (23 hours ago) Feb 25
to django-...@googlegroups.com
#36951: log_task_finished signal logs "NoneType: None" when no exception is raised
-------------------------------------+-------------------------------------
Reporter: Jacob Walls | Owner: Elias
| Hernandis
Type: Bug | Status: assigned
Component: Tasks | Version: 6.0
Severity: Release blocker | Resolution:
Keywords: | Triage Stage: Accepted
Has patch: 0 | Needs documentation: 1
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------
Changes (by Jacob Walls):

* needs_docs: 0 => 1
* stage: Ready for checkin => Accepted

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

Django

unread,
Feb 25, 2026, 12:18:19 PM (23 hours ago) Feb 25
to django-...@googlegroups.com
#36951: log_task_finished signal logs "NoneType: None" when no exception is raised
-------------------------------------+-------------------------------------
Reporter: Jacob Walls | Owner: Elias
| Hernandis
Type: Bug | Status: assigned
Component: Tasks | Version: 6.0
Severity: Release blocker | Resolution:
Keywords: | Triage Stage: Accepted
Has patch: 1 | Needs documentation: 1
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------
Changes (by Jake Howard):

* has_patch: 0 => 1


Old description:

> The test provided on #20722 demonstrates that faux exceptions are logged
> as `NoneType: None` by the `log_task_finished` signal:
>
> {{{#!py
> ======================================================================
> FAIL: test_successful_task_no_none_type_in_logs
> (tasks.test_immediate_backend.ImmediateBackendTestCase.test_successful_task_no_none_type_in_logs)
> ----------------------------------------------------------------------
> Traceback (most recent call last):
> File "/Users/jwalls/django/tests/tasks/test_immediate_backend.py", line
> 238, in test_successful_task_no_none_type_in_logs
> self.assertNotIn("NoneType", log_output)
> ~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^
> AssertionError: 'NoneType' unexpectedly found in 'INFO:django.tasks:Task
> id=1yKnLbcmTGMEUfj0B1JG0766LDM1Sono path=tasks.tasks.noop_task
> state=SUCCESSFUL\nNoneType: None'
>
> ----------------------------------------------------------------------
> }}}

New description:

The test provided on [https://github.com/django/django/pull/20722 PR
#20722] demonstrates that faux exceptions are logged as `NoneType: None`
by the `log_task_finished` signal:

{{{#!py
======================================================================
FAIL: test_successful_task_no_none_type_in_logs
(tasks.test_immediate_backend.ImmediateBackendTestCase.test_successful_task_no_none_type_in_logs)
----------------------------------------------------------------------
Traceback (most recent call last):
File "/Users/jwalls/django/tests/tasks/test_immediate_backend.py", line
238, in test_successful_task_no_none_type_in_logs
self.assertNotIn("NoneType", log_output)
~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^
AssertionError: 'NoneType' unexpectedly found in 'INFO:django.tasks:Task
id=1yKnLbcmTGMEUfj0B1JG0766LDM1Sono path=tasks.tasks.noop_task
state=SUCCESSFUL\nNoneType: None'

----------------------------------------------------------------------
}}}

--
--
Ticket URL: <https://code.djangoproject.com/ticket/36951#comment:4>
Reply all
Reply to author
Forward
0 new messages