https://github.com/python/cpython/commit/aa5b0ed2b428e796fbf8b1228cd76549ab268f83
commit: aa5b0ed2b428e796fbf8b1228cd76549ab268f83
branch: 3.14
author: Stan Ulbrych <[email protected]>
committer: StanFromIreland <[email protected]>
date: 2026-10-20T17:46:13Z
summary:
[3.14] Add Sphinx markup for CVEs in Changelog entries (GH-159415) (#159913)
(cherry picked from commit 44a2c1a5d9f460f8f5f1c09287a293e77ac3aa2e)
files:
M Doc/tools/extensions/misc_news.py
diff --git a/Doc/tools/extensions/misc_news.py
b/Doc/tools/extensions/misc_news.py
index a24c440595ee92f..e73b6b8f27a2115 100644
--- a/Doc/tools/extensions/misc_news.py
+++ b/Doc/tools/extensions/misc_news.py
@@ -30,6 +30,9 @@
gh_issue_re: Final[re.Pattern[str]] = re.compile(
"gh-(?:issue-)?([0-9]+)", re.ASCII | re.IGNORECASE
)
+cve_re: Final[re.Pattern[str]] = re.compile(
+ "CVE-([0-9]{4}-[0-9]{4,})", re.ASCII | re.IGNORECASE
+)
whatsnew_re: Final[re.Pattern[str]] = re.compile(
r"^what's new in (.*?)\??$", re.ASCII | re.IGNORECASE | re.MULTILINE
)
@@ -59,6 +62,7 @@ def run(self) -> list[Node]:
news_text = bpo_issue_re.sub(r":issue:`\1`", news_text)
# Fallback handling for GitHub issues
news_text = gh_issue_re.sub(r":gh:`\1`", news_text)
+ news_text = cve_re.sub(r":cve:`\1`", news_text)
news_text = whatsnew_re.sub(r"\1", news_text)
self.state_machine.insert_input(news_text.splitlines(), str(news_file))
_______________________________________________
Python-checkins mailing list -- [email protected]
To unsubscribe send an email to [email protected]
https://mail.python.org/mailman3//lists/python-checkins.python.org
Member address: [email protected]