]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
gh-125895: Fix static asset location for `sphinx-notfound-page` (#147984)
authorStan Ulbrych <stan@python.org>
Fri, 3 Apr 2026 15:19:30 +0000 (16:19 +0100)
committerGitHub <noreply@github.com>
Fri, 3 Apr 2026 15:19:30 +0000 (16:19 +0100)
Doc/conf.py

index 07e0d113a24c104c986a9a8706ab828bc061514e..f021c9eabe4dda15d821783231f5f88578a04665 100644 (file)
@@ -572,6 +572,17 @@ refcount_file = 'data/refcounts.dat'
 stable_abi_file = 'data/stable_abi.dat'
 threadsafety_file = 'data/threadsafety.dat'
 
+# Options for notfound.extension
+# -------------------------------
+
+if not os.getenv("READTHEDOCS"):
+    if language_code:
+        notfound_urls_prefix = (
+            f'/{language_code.replace("_", "-").lower()}/{version}/'
+        )
+    else:
+        notfound_urls_prefix = f'/{version}/'
+
 # Options for sphinxext-opengraph
 # -------------------------------