Skip to content

Commit aebbd75

Browse files
authored
gh-92448: Update the documentation builder to render the GitHub issue (GH-92600)
1 parent 73317e3 commit aebbd75

File tree

4 files changed

+8
-7
lines changed

4 files changed

+8
-7
lines changed

Doc/tools/extensions/pyspecific.py

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -309,7 +309,8 @@ def run(self):
309309

310310
# Support for including Misc/NEWS
311311

312-
issue_re = re.compile('(?:[Ii]ssue #|bpo-)([0-9]+)')
312+
issue_re = re.compile('(?:[Ii]ssue #|bpo-)([0-9]+)', re.I)
313+
gh_issue_re = re.compile('(?:gh-issue-|gh-)([0-9]+)', re.I)
313314
whatsnew_re = re.compile(r"(?im)^what's new in (.*?)\??$")
314315

315316

@@ -336,9 +337,9 @@ def run(self):
336337
text = 'The NEWS file is not available.'
337338
node = nodes.strong(text, text)
338339
return [node]
339-
content = issue_re.sub(r'`bpo-\1 <https://bugs.python.org/'
340-
r'issue?@action=redirect&bpo=\1>`__',
341-
content)
340+
content = issue_re.sub(r':issue:`\1`', content)
341+
# Fallback handling for the GitHub issue
342+
content = gh_issue_re.sub(r':gh:`\1`', content)
342343
content = whatsnew_re.sub(r'\1', content)
343344
# remove first 3 lines as they are the main heading
344345
lines = ['.. default-role:: obj', ''] + content.splitlines()[3:]

Misc/NEWS.d/3.7.0a3.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -289,7 +289,7 @@ by Nir Soffer.
289289

290290
..
291291
292-
.. bpo: 321010
292+
.. bpo: 32101
293293
.. date: 2017-11-29-00-42-47
294294
.. nonce: -axD5l
295295
.. section: Library

Misc/NEWS.d/3.7.5.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ Prevent ctypes crash when handling arrays in structs/unions.
1313
.. nonce: 9TWMlz
1414
.. section: Library
1515
16-
Revert GH-15522, which introduces a regression in
16+
Revert PR 15522, which introduces a regression in
1717
:meth:`mimetypes.guess_type` due to improper handling of filenames as urls.
1818

1919
..

Misc/NEWS.d/3.7.7rc1.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -180,7 +180,7 @@ Remove obsolete check for `__args__` in bdb.Bdb.format_stack_entry.
180180
.. section: Library
181181
182182
The original fix for bpo-27657, "Fix urlparse() with numeric paths"
183-
(GH-16839) included in 3.7.6, inadvertently introduced a behavior change
183+
(PR 16839) included in 3.7.6, inadvertently introduced a behavior change
184184
that broke several third-party packages relying on the original undefined
185185
parsing behavior. The change is reverted in 3.7.7, restoring the behavior of
186186
3.7.5 and earlier releases.

0 commit comments

Comments
 (0)