Re: [Django] #36696: Using deferred annotations on signals, tasks, etc. in Python 3.14 raises NameError

8 views
Skip to first unread message

Django

unread,
Oct 30, 2025, 4:06:48 AM10/30/25
to django-...@googlegroups.com
#36696: Using deferred annotations on signals, tasks, etc. in Python 3.14 raises
NameError
-------------------------------------+-------------------------------------
Reporter: Patrick Rauscher | Owner: Patrick
| Rauscher
Type: Bug | Status: assigned
Component: Utilities | Version: 5.2
Severity: Release blocker | Resolution:
Keywords: | Triage Stage: Accepted
typing,inspect,deferred |
annotations |
Has patch: 0 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------
Changes (by Patrick Rauscher):

* owner: (none) => Patrick Rauscher
* status: new => assigned

Comment:

I will try and draft a PR :)
--
Ticket URL: <https://code.djangoproject.com/ticket/36696#comment:3>
Django <https://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.

Django

unread,
Oct 30, 2025, 5:25:57 AM10/30/25
to django-...@googlegroups.com
#36696: Using deferred annotations on signals, tasks, etc. in Python 3.14 raises
NameError
-------------------------------------+-------------------------------------
Reporter: Patrick Rauscher | Owner: Patrick
| Rauscher
Type: Bug | Status: assigned
Component: Utilities | Version: 5.2
Severity: Release blocker | Resolution:
Keywords: | Triage Stage: Accepted
typing,inspect,deferred |
annotations |
Has patch: 1 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------
Changes (by Patrick Rauscher):

* has_patch: 0 => 1

Comment:

Drafted a [https://github.com/django/django/pull/20024 PR] in GitHub,
still waiting for the test suite to start up and confirm.
--
Ticket URL: <https://code.djangoproject.com/ticket/36696#comment:4>

Django

unread,
Oct 30, 2025, 6:01:04 PM10/30/25
to django-...@googlegroups.com
#36696: Using deferred annotations on signals, tasks, etc. in Python 3.14 raises
NameError
-------------------------------------+-------------------------------------
Reporter: Patrick Rauscher | Owner: Patrick
| Rauscher
Type: Bug | Status: assigned
Component: Utilities | Version: 5.2
Severity: Release blocker | Resolution:
Keywords: | Triage Stage: Ready for
typing,inspect,deferred | checkin
annotations |
Has patch: 1 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------
Changes (by Jacob Walls):

* stage: Accepted => Ready for checkin

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

Django

unread,
Oct 31, 2025, 8:44:50 AM10/31/25
to django-...@googlegroups.com
#36696: Using deferred annotations on signals, tasks, etc. in Python 3.14 raises
NameError
-------------------------------------+-------------------------------------
Reporter: Patrick Rauscher | Owner: Patrick
| Rauscher
Type: Bug | Status: closed
Component: Utilities | Version: 5.2
Severity: Release blocker | Resolution: fixed
Keywords: | Triage Stage: Ready for
typing,inspect,deferred | checkin
annotations |
Has patch: 1 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------
Changes (by Jacob Walls <jacobtylerwalls@…>):

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

Comment:

In [changeset:"601914722956cc41f1f2c53972d669ddee6ffc04" 6019147]:
{{{#!CommitTicketReference repository=""
revision="601914722956cc41f1f2c53972d669ddee6ffc04"
Fixed #36696 -- Fixed NameError when inspecting functions with deferred
annotations.

In Python 3.14, annotations are deferred by default, so we should not
assume that the names in them have been imported unconditionally.
}}}
--
Ticket URL: <https://code.djangoproject.com/ticket/36696#comment:6>

Django

unread,
Oct 31, 2025, 8:45:39 AM10/31/25
to django-...@googlegroups.com
#36696: Using deferred annotations on signals, tasks, etc. in Python 3.14 raises
NameError
-------------------------------------+-------------------------------------
Reporter: Patrick Rauscher | Owner: Patrick
| Rauscher
Type: Bug | Status: closed
Component: Utilities | Version: 5.2
Severity: Release blocker | Resolution: fixed
Keywords: | Triage Stage: Ready for
typing,inspect,deferred | checkin
annotations |
Has patch: 1 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------
Comment (by Jacob Walls <jacobtylerwalls@…>):

In [changeset:"953d31028a48911777d932e3ea76bedb2daf6ad8" 953d310]:
{{{#!CommitTicketReference repository=""
revision="953d31028a48911777d932e3ea76bedb2daf6ad8"
[6.0.x] Fixed #36696 -- Fixed NameError when inspecting functions with
deferred annotations.

In Python 3.14, annotations are deferred by default, so we should not
assume that the names in them have been imported unconditionally.

Backport of 601914722956cc41f1f2c53972d669ddee6ffc04 from main.
}}}
--
Ticket URL: <https://code.djangoproject.com/ticket/36696#comment:7>

Django

unread,
Oct 31, 2025, 8:48:02 AM10/31/25
to django-...@googlegroups.com
#36696: Using deferred annotations on signals, tasks, etc. in Python 3.14 raises
NameError
-------------------------------------+-------------------------------------
Reporter: Patrick Rauscher | Owner: Patrick
| Rauscher
Type: Bug | Status: closed
Component: Utilities | Version: 5.2
Severity: Release blocker | Resolution: fixed
Keywords: | Triage Stage: Ready for
typing,inspect,deferred | checkin
annotations |
Has patch: 1 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------
Comment (by Jacob Walls <jacobtylerwalls@…>):

In [changeset:"6775888470317a6d69121779b489bb2dc7350318" 6775888]:
{{{#!CommitTicketReference repository=""
revision="6775888470317a6d69121779b489bb2dc7350318"
[5.2.x] Fixed #36696 -- Fixed NameError when inspecting functions with
deferred annotations.

In Python 3.14, annotations are deferred by default, so we should not
assume that the names in them have been imported unconditionally.
}}}
--
Ticket URL: <https://code.djangoproject.com/ticket/36696#comment:8>
Reply all
Reply to author
Forward
0 new messages