#1145438 python-django: FTBFS against python 3.15rc1

#1145438#5
Date:
2026-08-25 07:25:16 UTC
From:
To:
Hi!

While rebuilding the python related packages against the Python 3.15rc1
version we found that python-django fails to build from source [1].

There are three separate issues related to python 3.15.

First, tests failing with `NameError: name 'SomeType' is not defined.
Did you mean: 'TokenType'?`. This was fixed upstream with Commit e7f539f
[2].

Second, the error message for `test_invalid_choice_db_option` has
changed. To fix this, it required applying a few upstream patches [3]
[4].

Third, test_strip_tags failed with `sys.version_info >=
min_fixed_security[sys.version_info[:2]] KeyError: (3, 15)`, this is
caused by line 136 of tests/utils_tests/test_html.py, which defines
htmlparser_fixed_security but that's never used and it's later recrated
in line 151 in a way that avoids the error, the related upstream fix
about this is in [5], but backporting the fix is actually only deleting
the line 136.

I applied the upstream fixes in the sandbox [5] to be able to build the
packages that depend on python-django, please consider applying the
patch to support the upcoming 3.15 version.

Happy hacking,

[1]: https://debusine.debian.net/debian/r-python-python3.15/artifact/4415709/raw/python-django_5.2.17-1+py315.1_amd64-2026-08-22T01:25:30Z.build
[2]: https://github.com/django/django/commit/e7f539f813bd56a71ca3c1fbf379f47691002086
[3]: https://github.com/django/django/pull/20021
[4]: https://github.com/django/django/commit/ed13a58bf63df94508c8a0fe779da0b6a2bc26bb
[5]: https://github.com/django/django/commit/185b049
[6]: https://debusine.debian.net/debian/r-python-python3.15/