From 97c00e4d0ee5cd35edd0c2c3dc4f57a0fd9c0dac Mon Sep 17 00:00:00 2001 From: Alvyn Abranches Date: Mon, 12 Oct 2026 01:17:10 +0530 Subject: [PATCH 1/2] Fix #3149: use documentation.yml template for CPython docs issues The CPython repo uses documentation.yml, not documentation.md. The old link opened a blank issue template. Updated in BUG, DOCS, and REQUEST issue templates. --- .github/ISSUE_TEMPLATE/BUG.yml | 2 +- .github/ISSUE_TEMPLATE/DOCS.yml | 2 +- .github/ISSUE_TEMPLATE/REQUEST.yml | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/ISSUE_TEMPLATE/BUG.yml b/.github/ISSUE_TEMPLATE/BUG.yml index f75b4a61c..56c2b89f9 100644 --- a/.github/ISSUE_TEMPLATE/BUG.yml +++ b/.github/ISSUE_TEMPLATE/BUG.yml @@ -11,7 +11,7 @@ body: If you're looking to file an issue with CPython itself, please click here: [CPython Issues](https://github.com/python/cpython/issues/new/choose). - Issues related to [Python's documentation](https://docs.python.org) can also be filed [here](https://github.com/python/cpython/issues/new?assignees=&labels=docs&template=documentation.md). + Issues related to [Python's documentation](https://docs.python.org) can also be filed [here](https://github.com/python/cpython/issues/new?assignees=&labels=docs&template=documentation.yml). - type: textarea id: description diff --git a/.github/ISSUE_TEMPLATE/DOCS.yml b/.github/ISSUE_TEMPLATE/DOCS.yml index 2f216878a..857bc77a8 100644 --- a/.github/ISSUE_TEMPLATE/DOCS.yml +++ b/.github/ISSUE_TEMPLATE/DOCS.yml @@ -11,7 +11,7 @@ body: If you're looking to file an issue with CPython itself, please click here: [CPython Issues](https://github.com/python/cpython/issues/new/choose). - Issues related to [Python's documentation](https://docs.python.org) can also be filed [here](https://github.com/python/cpython/issues/new?assignees=&labels=docs&template=documentation.md). + Issues related to [Python's documentation](https://docs.python.org) can also be filed [here](https://github.com/python/cpython/issues/new?assignees=&labels=docs&template=documentation.yml). - type: textarea id: summary diff --git a/.github/ISSUE_TEMPLATE/REQUEST.yml b/.github/ISSUE_TEMPLATE/REQUEST.yml index c0f29e2c0..c2dd2363b 100644 --- a/.github/ISSUE_TEMPLATE/REQUEST.yml +++ b/.github/ISSUE_TEMPLATE/REQUEST.yml @@ -11,7 +11,7 @@ body: If you're looking to file an issue with CPython itself, please click here: [CPython Issues](https://github.com/python/cpython/issues/new/choose). - Issues related to [Python's documentation](https://docs.python.org) can also be filed [here](https://github.com/python/cpython/issues/new?assignees=&labels=docs&template=documentation.md). + Issues related to [Python's documentation](https://docs.python.org) can also be filed [here](https://github.com/python/cpython/issues/new?assignees=&labels=docs&template=documentation.yml). - type: textarea id: problem From d9f5fbcc5ca99ab5ed726029cc83d43339891bdf Mon Sep 17 00:00:00 2001 From: Alvyn Abranches Date: Mon, 12 Oct 2026 01:18:57 +0530 Subject: [PATCH 2/2] Fix downloads URL reversing bugs OS.get_absolute_url used os_slug kwarg but route expects slug, causing NoReverseMatch on every call. Fallback redirects in DownloadLatestPython2 and DownloadLatestPyManager used bare names (download/downloads) that do not exist, causing 500 when no latest release is flagged. Standardize fallbacks and feed link on download:download namespace. Added regression tests for OS URL and fallback redirects. --- apps/downloads/models.py | 2 +- apps/downloads/tests/test_models.py | 4 ++++ apps/downloads/tests/test_views.py | 14 ++++++++++++++ apps/downloads/views.py | 10 +++++----- 4 files changed, 24 insertions(+), 6 deletions(-) diff --git a/apps/downloads/models.py b/apps/downloads/models.py index e7cfe30f2..bd2b5199f 100644 --- a/apps/downloads/models.py +++ b/apps/downloads/models.py @@ -55,7 +55,7 @@ def __str__(self): def get_absolute_url(self): """Return the URL for this OS's download list page.""" - return reverse("download:download_os_list", kwargs={"os_slug": self.slug}) + return reverse("download:download_os_list", kwargs={"slug": self.slug}) class Release(ContentManageable, NameSlugModel): diff --git a/apps/downloads/tests/test_models.py b/apps/downloads/tests/test_models.py index bdd04d5ef..3b4df7698 100644 --- a/apps/downloads/tests/test_models.py +++ b/apps/downloads/tests/test_models.py @@ -28,6 +28,10 @@ def test_stringification(self): self.assertEqual(str(self.osx), "macOS") self.assertEqual(str(self.release_275), "Python 2.7.5") + def test_os_get_absolute_url(self): + """OS detail URL reverses with the `slug` kwarg.""" + self.assertEqual(self.linux.get_absolute_url(), f"/downloads/{self.linux.slug}/") + def test_published(self): published_releases = Release.objects.published() self.assertEqual(len(published_releases), 7) diff --git a/apps/downloads/tests/test_views.py b/apps/downloads/tests/test_views.py index f7f86129c..edbf82ecc 100644 --- a/apps/downloads/tests/test_views.py +++ b/apps/downloads/tests/test_views.py @@ -143,6 +143,20 @@ def test_latest_prerelease_redirect_when_no_prerelease(self): response = self.client.get(url) self.assertRedirects(response, reverse("download:download")) + def test_latest_python2_redirects_to_downloads_when_no_latest(self): + """Fallback redirect must reverse correctly when no Python 2 is flagged latest.""" + Release.objects.filter(version=Release.PYTHON2).update(is_latest=False) + url = reverse("download:download_latest_python2") + response = self.client.get(url) + self.assertRedirects(response, reverse("download:download")) + + def test_latest_pymanager_redirects_to_downloads_when_no_latest(self): + """No pymanager fixture exists, so this always exercises the fallback.""" + self.assertIsNone(Release.objects.latest_pymanager()) + url = reverse("download:download_latest_pymanager") + response = self.client.get(url) + self.assertRedirects(response, reverse("download:download")) + def test_redirect_page_object_to_release_detail_page(self): self.release_275.release_page = None self.release_275.save() diff --git a/apps/downloads/views.py b/apps/downloads/views.py index 01dd4a33d..b5f532861 100644 --- a/apps/downloads/views.py +++ b/apps/downloads/views.py @@ -29,7 +29,7 @@ def get_redirect_url(self, **kwargs): if latest_python2: return latest_python2.get_absolute_url() - return reverse("download") + return reverse("download:download") class DownloadLatestPython3(RedirectView): @@ -48,7 +48,7 @@ def get_redirect_url(self, **kwargs): if latest_release: return latest_release.get_absolute_url() - return reverse("downloads:download") + return reverse("download:download") class DownloadLatestPrerelease(RedirectView): @@ -65,7 +65,7 @@ def get_redirect_url(self, **kwargs): if latest_prerelease: return latest_prerelease.get_absolute_url() - return reverse("downloads:download") + return reverse("download:download") class DownloadLatestPyManager(RedirectView): @@ -82,7 +82,7 @@ def get_redirect_url(self, **kwargs): if latest_pymanager: return latest_pymanager.get_absolute_url() - return reverse("downloads") + return reverse("download:download") class DownloadBase: @@ -267,7 +267,7 @@ class ReleaseFeed(Feed): @staticmethod def link() -> str: """Return the URL to the main downloads page.""" - return reverse("downloads:download") + return reverse("download:download") def items(self) -> list[dict[str, Any]]: """Return the latest Python releases."""