From ef79a2bc70987727b183685b67cf550de294eecb Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Michal=20=C4=8Ciha=C5=99?=
Date: Wed, 16 Mar 2022 13:21:12 +0100
Subject: [PATCH] environment: Update default value for pep_base_url
This matches docutils change in https://sourceforge.net/p/docutils/code/9045/
Fixes #10253
---
sphinx/environment/__init__.py | 2 +-
tests/test_build_html.py | 4 ++--
tests/test_markup.py | 8 ++++----
3 files changed, 7 insertions(+), 7 deletions(-)
diff --git a/sphinx/environment/__init__.py b/sphinx/environment/__init__.py
index b5b13524122..07c003b3e0d 100644
--- a/sphinx/environment/__init__.py
+++ b/sphinx/environment/__init__.py
@@ -41,7 +41,7 @@
'embed_images': False,
'embed_stylesheet': False,
'cloak_email_addresses': True,
- 'pep_base_url': 'https://www.python.org/dev/peps/',
+ 'pep_base_url': 'https://peps.python.org/',
'pep_references': None,
'rfc_base_url': 'https://datatracker.ietf.org/doc/html/',
'rfc_references': None,
diff --git a/tests/test_build_html.py b/tests/test_build_html.py
index f50f72a9c9c..77371d00237 100644
--- a/tests/test_build_html.py
+++ b/tests/test_build_html.py
@@ -212,9 +212,9 @@ def test_html4_output(app, status, warning):
(".//li/p/code/span[@class='pre']", '^a/$'),
(".//li/p/code/em/span[@class='pre']", '^varpart$'),
(".//li/p/code/em/span[@class='pre']", '^i$'),
- (".//a[@href='https://www.python.org/dev/peps/pep-0008']"
+ (".//a[@href='https://peps.python.org/pep-0008']"
"[@class='pep reference external']/strong", 'PEP 8'),
- (".//a[@href='https://www.python.org/dev/peps/pep-0008']"
+ (".//a[@href='https://peps.python.org/pep-0008']"
"[@class='pep reference external']/strong",
'Python Enhancement Proposal #8'),
(".//a[@href='https://datatracker.ietf.org/doc/html/rfc1.html']"
diff --git a/tests/test_markup.py b/tests/test_markup.py
index 39ad62784b3..6ec592073e5 100644
--- a/tests/test_markup.py
+++ b/tests/test_markup.py
@@ -150,10 +150,10 @@ def get(name):
':pep:`8`',
# since docutils-0.19, :pep: role points to python.org via https schema
('PEP 8
'),
+ 'href="https?://(www.python.org/dev/peps|peps.python.org)/pep-0008">PEP 8
'),
(r'\\sphinxAtStartPar\n'
r'\\index{Python Enhancement Proposals@\\spxentry{Python Enhancement Proposals}'
- r'!PEP 8@\\spxentry{PEP 8}}\\sphinxhref{https?://www.python.org/dev/peps/pep-0008}'
+ r'!PEP 8@\\spxentry{PEP 8}}\\sphinxhref{https?://(www.python.org/dev/peps|peps.python.org)/pep-0008}'
r'{\\sphinxstylestrong{PEP 8}}')
),
(
@@ -162,12 +162,12 @@ def get(name):
':pep:`8#id1`',
# since docutils-0.19, :pep: role points to python.org via https schema
(''
+ 'href="https?://(www.python.org/dev/peps|peps.python.org)/pep-0008#id1">'
'PEP 8#id1
'),
(r'\\sphinxAtStartPar\n'
r'\\index{Python Enhancement Proposals@\\spxentry{Python Enhancement Proposals}'
r'!PEP 8\\#id1@\\spxentry{PEP 8\\#id1}}\\sphinxhref'
- r'{https?://www.python.org/dev/peps/pep-0008\\#id1}'
+ r'{https?://(www.python.org/dev/peps|peps.python.org)/pep-0008\\#id1}'
r'{\\sphinxstylestrong{PEP 8\\#id1}}')
),
(