#35844 closed New feature (fixed)
Python 3.14 compatibility.
| Reported by: | Mariusz Felisiak | Owned by: | Mariusz Felisiak |
|---|---|---|---|
| Component: | Core (Other) | Version: | dev |
| Severity: | Normal | Keywords: | |
| Cc: | Michał Górny | Triage Stage: | Ready for checkin |
| Has patch: | yes | Needs documentation: | no |
| Needs tests: | no | Patch needs improvement: | no |
| Easy pickings: | no | UI/UX: | no |
Description
Python 3.14 final is scheduled for October 2025 (see PEP 745). This is a tracking ticket for compatibility fixes for Django submitted in the meantime.
Django 5.2 will be the first version to support Python 3.14, because Django 5.1 will end the mainstream support in April 2024.
Change History (30)
comment:1 by , 13 months ago
| Triage Stage: | Unreviewed → Accepted |
|---|---|
| Version: | 5.0 → dev |
comment:2 by , 13 months ago
follow-up: 12 comment:7 by , 12 months ago
FYI: urljoin() behavior change has been accepted as a regression in Python 3.14, https://github.com/python/cpython/issues/125926.
comment:12 by , 12 months ago
Replying to Mariusz Felisiak:
FYI:
urljoin()behavior change has been accepted as a regression in Python 3.14, https://github.com/python/cpython/issues/125926.
Fixed in https://github.com/python/cpython/commit/dbb6e22cb1f533bba00a61a5b63ec68af9d48836.
comment:19 by , 3 months ago
| Cc: | added |
|---|
comment:22 by , 12 days ago
| Triage Stage: | Accepted → Ready for checkin |
|---|
comment:28 by , 12 days ago
| Resolution: | → fixed |
|---|---|
| Status: | assigned → closed |
comment:29 by , 7 days ago
GHA are showing this error on test runs on linux, which I also get locally:
======================================================================
FAIL: test_custom_project_template_context_variables (admin_scripts.tests.StartProject.test_custom_project_template_context_variables)
Make sure template context variables are rendered with proper values
----------------------------------------------------------------------
Traceback (most recent call last):
File "/opt/hostedtoolcache/Python/3.14.0/x64/lib/python3.14/unittest/case.py", line 58, in testPartExecutor
yield
File "/opt/hostedtoolcache/Python/3.14.0/x64/lib/python3.14/unittest/case.py", line 669, in run
self._callTestMethod(testMethod)
File "/opt/hostedtoolcache/Python/3.14.0/x64/lib/python3.14/unittest/case.py", line 615, in _callTestMethod
result = method()
^^^^^^^^^^^^^^^
File "/home/runner/work/django/django/tests/admin_scripts/tests.py", line 2859, in test_custom_project_template_context_variables
self.assertIn('project_directory = "%s"' % testproject_dir, content)
^^^^^^^^^^^
File "/opt/hostedtoolcache/Python/3.14.0/x64/lib/python3.14/unittest/case.py", line 1192, in assertIn
self.fail(self._formatMessage(msg, standardMsg))
^^^^^^^^^^^
File "/opt/hostedtoolcache/Python/3.14.0/x64/lib/python3.14/unittest/case.py", line 750, in fail
raise self.failureException(msg)
^^^^^^^^^^^^^^^
AssertionError: 'project_directory = "/tmp/django_znh73pf9/django_hl40h621/tmp44uj0vns/test_project/project_dir"' not found in '# The manage.py of the another_project test project\n\n# template context:\nproject_name = "another_project"\nproject_directory = (\n "/tmp/django_znh73pf9/django_hl40h621/tmp44uj0vns/test_project/project_dir"\n)\nsecret_key = "django-insecure-j8z2ob$oh3de^_2&lv=z9b+=h*pnh_c#y3##je+%jy&a6+prr1"\n'
I'll work on a fix.
comment:30 by , 7 days ago
Created #36680 to track the test failure. This is about temp dirs having longer names (likely related to Python 3.14 and forkserver) and having black installed in the venv.
Initial PRs:
After applying these 3 changes we'll have one more deprecation warning, 49 test failures, and 24 test errors. All of them are under investigation of Team Venus of the 3rd Djangonauts cohort, PRs will be submitted soonish :)