https://github.com/python/cpython/commit/bb130d8a075f3b8171d1bb27a1313d060c462c96
commit: bb130d8a075f3b8171d1bb27a1313d060c462c96
branch: 3.12
author: Miss Islington (bot) <[email protected]>
committer: Yhg1s <[email protected]>
date: 2026-10-20T11:22:31-07:00
summary:

[3.12] Add Sphinx markup for CVEs in Changelog entries (GH-159415) (GH-159913) 
(#159925)

[3.14] Add Sphinx markup for CVEs in Changelog entries (GH-159415) (GH-159913)
(cherry picked from commit aa5b0ed2b428e796fbf8b1228cd76549ab268f83)


(cherry picked from commit 44a2c1a5d9f460f8f5f1c09287a293e77ac3aa2e)

Co-authored-by: Stan Ulbrych <[email protected]>

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]

Reply via email to