fix: remap dead hg.python.org release-notes URLs to GitHub equivalents by nagasrisai · Pull Request #2965 · python/pythondotorg

added 3 commits

March 18, 2026 17:40
Adds a corrected_release_notes_url property to the Release model that
converts old Mercurial-hosted URLs (hg.python.org, now unreachable) to
their equivalent paths on GitHub, so legacy release pages still have
working changelog links.

Closes python#2865
Use the new corrected_release_notes_url property so that legacy
hg.python.org links are converted to GitHub URLs before rendering.
Also guard the anchor so it degrades gracefully when the URL is empty.
Covers hg URL conversion, https variant, modern URLs left unchanged,
and empty URL passthrough.

@nagasrisai

hugovk

Per review suggestion from hugovk:
- Replace re.match with str.startswith for clarity (re.match anchors start
  but not end, which can be confusing)
- Also handle hg.python.org/cpython/raw-file/ URLs, mapping them to
  raw.githubusercontent.com (e.g. Python 2.7.3 release notes use this form)

@nagasrisai