From 480234488cb61fc93a67ad257fe347adc3e9edaa Mon Sep 17 00:00:00 2001 From: Dong-hee Na <donghee.na@python.org> Date: Sun, 8 May 2022 22:21:05 +0900 Subject: [PATCH] [3.9] gh-92448: Update the documentation builder to render the GitHub issue. (GH-92449). (GH-92458) --- Doc/tools/extensions/pyspecific.py | 9 +++++---- Misc/NEWS.d/3.7.0a3.rst | 2 +- Misc/NEWS.d/3.8.0a1.rst | 2 +- Misc/NEWS.d/3.9.0a1.rst | 2 +- 4 files changed, 8 insertions(+), 7 deletions(-) diff --git a/Doc/tools/extensions/pyspecific.py b/Doc/tools/extensions/pyspecific.py index 6c819866976..4575300f537 100644 --- a/Doc/tools/extensions/pyspecific.py +++ b/Doc/tools/extensions/pyspecific.py @@ -391,7 +391,8 @@ def run(self): # Support for including Misc/NEWS -issue_re = re.compile('(?:[Ii]ssue #|bpo-)([0-9]+)') +issue_re = re.compile('(?:[Ii]ssue #|bpo-)([0-9]+)', re.I) +gh_issue_re = re.compile('(?:gh-issue-|gh-)([0-9]+)', re.I) whatsnew_re = re.compile(r"(?im)^what's new in (.*?)\??$") @@ -418,9 +419,9 @@ def run(self): text = 'The NEWS file is not available.' node = nodes.strong(text, text) return [node] - content = issue_re.sub(r'`bpo-\1 <https://bugs.python.org/' - r'issue?@action=redirect&bpo=\1>`__', - content) + content = issue_re.sub(r':issue:`\1`', content) + # Fallback handling for the GitHub issue + content = gh_issue_re.sub(r':gh:`\1`', content) content = whatsnew_re.sub(r'\1', content) # remove first 3 lines as they are the main heading lines = ['.. default-role:: obj', ''] + content.splitlines()[3:] diff --git a/Misc/NEWS.d/3.7.0a3.rst b/Misc/NEWS.d/3.7.0a3.rst index 067720efa51..6576c1fadbf 100644 --- a/Misc/NEWS.d/3.7.0a3.rst +++ b/Misc/NEWS.d/3.7.0a3.rst @@ -288,7 +288,7 @@ by Nir Soffer. .. -.. bpo: 321010 +.. bpo: 32101 .. date: 2017-11-29-00-42-47 .. nonce: -axD5l .. section: Library diff --git a/Misc/NEWS.d/3.8.0a1.rst b/Misc/NEWS.d/3.8.0a1.rst index 657ea5cab92..16e23a192a7 100644 --- a/Misc/NEWS.d/3.8.0a1.rst +++ b/Misc/NEWS.d/3.8.0a1.rst @@ -4617,7 +4617,7 @@ Based on patch by c-fos. .. section: Library Remove HMAC default to md5 marked for removal in 3.8 (removal originally -planned in 3.6, bump to 3.8 in gh-7062). +planned in 3.6, bump to 3.8 in PR 7062). .. diff --git a/Misc/NEWS.d/3.9.0a1.rst b/Misc/NEWS.d/3.9.0a1.rst index a9b6694c133..45f232f1948 100644 --- a/Misc/NEWS.d/3.9.0a1.rst +++ b/Misc/NEWS.d/3.9.0a1.rst @@ -1335,7 +1335,7 @@ module on POSIX systems. .. nonce: 9TWMlz .. section: Library -Revert GH-15522, which introduces a regression in +Revert PR 15522, which introduces a regression in :meth:`mimetypes.guess_type` due to improper handling of filenames as urls. .. -- GitLab