From 8ed868db8f0275c17690a1703e406d240d9ce021 Mon Sep 17 00:00:00 2001 From: Stan Ulbrych Date: Fri, 3 Apr 2026 16:19:30 +0100 Subject: [PATCH] gh-125895: Fix static asset location for `sphinx-notfound-page` (GH-147984) (cherry picked from commit 80ab6d958a0e4aa322aaf96994c43cd637496be6) Co-authored-by: Stan Ulbrych --- Doc/conf.py | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/Doc/conf.py b/Doc/conf.py index f24a4d1fa1a3b8..78baab4ad1e941 100644 --- a/Doc/conf.py +++ b/Doc/conf.py @@ -570,6 +570,17 @@ 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 # -------------------------------