f657771
From 4944f6ff75e0a5e28d9719ae30dba03f196f2acf Mon Sep 17 00:00:00 2001
f657771
From: =?UTF-8?q?Miro=20Hron=C4=8Dok?= <miro@hroncok.cz>
f657771
Date: Tue, 21 Mar 2023 16:42:09 +0100
f657771
Subject: [PATCH] Make sphinx.ext.extlinks captions actual string templates
f657771
f657771
In Sphinx 3, this used to be a prefix, but it is the full caption since Sphinx 4:
f657771
f657771
https://github.com/sphinx-doc/sphinx/commit/fb39974486ab09320f0cf45f3c0ba0175f04d7d6
f657771
f657771
With Sphinx 6, captions without %s fail:
f657771
f657771
https://github.com/sphinx-doc/sphinx/commit/ce31e1c0c7b32f6be93186e0fef076ef65ff0b05
f657771
f657771
    Exception occurred:
f657771
    File "/usr/lib/python3.11/site-packages/sphinx/ext/extlinks.py", line 103, in role
f657771
    title = caption % part
f657771
            ~~~~~~~~^~~~~~
f657771
    TypeError: not all arguments converted during string formatting
f657771
f657771
Fixes Fedora downstream report: https://bugzilla.redhat.com/2180479
f657771
---
f657771
 docs/html/conf.py | 6 +++---
f657771
 1 file changed, 3 insertions(+), 3 deletions(-)
f657771
f657771
diff --git a/docs/html/conf.py b/docs/html/conf.py
f657771
index cc967e0ba3c..aae1364b87a 100644
f657771
--- a/docs/html/conf.py
f657771
+++ b/docs/html/conf.py
f657771
@@ -74,9 +74,9 @@
f657771
 # -- Options for extlinks -------------------------------------------------------------
f657771
 
f657771
 extlinks = {
f657771
-    "issue": ("https://github.com/pypa/pip/issues/%s", "#"),
f657771
-    "pull": ("https://github.com/pypa/pip/pull/%s", "PR #"),
f657771
-    "pypi": ("https://pypi.org/project/%s/", ""),
f657771
+    "issue": ("https://github.com/pypa/pip/issues/%s", "#%s"),
f657771
+    "pull": ("https://github.com/pypa/pip/pull/%s", "PR #%s"),
f657771
+    "pypi": ("https://pypi.org/project/%s/", "%s"),
f657771
 }
f657771
 
f657771
 # -- Options for towncrier_draft extension --------------------------------------------