From 7bd9c59435904393175e5f4a1ef5d1b9b4ed4d15 Mon Sep 17 00:00:00 2001 From: mkay Date: Fri, 15 Mar 2024 09:27:23 +0100 Subject: [PATCH] [htmlhelp] do not add checksums to css files if building using the htmlhelp builder (#11894) Co-authored-by: Jan-Hendrik Garber Co-authored-by: Adam Turner <9087854+aa-turner@users.noreply.github.com> --- CHANGES.rst | 2 ++ sphinx/builders/html/__init__.py | 4 +++- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/CHANGES.rst b/CHANGES.rst index cc0b0d26c0d..80ccbddd504 100644 --- a/CHANGES.rst +++ b/CHANGES.rst @@ -96,6 +96,8 @@ Bugs fixed * #11278: autodoc: Fix rendering of :class:`functools.singledispatchmethod` combined with :func:`@classmethod `. Patch by Bénédikt Tran. +* #11894: Do not add checksums to css files if building using the htmlhelp builder. + Patch by mkay. Testing ------- diff --git a/sphinx/builders/html/__init__.py b/sphinx/builders/html/__init__.py index 42768f4d8e2..9c405d0ba54 100644 --- a/sphinx/builders/html/__init__.py +++ b/sphinx/builders/html/__init__.py @@ -1052,7 +1052,9 @@ def css_tag(css: _CascadingStyleSheet) -> str: if value is not None] uri = pathto(os.fspath(css.filename), resource=True) # the EPUB format does not allow the use of query components - if self.name != 'epub': + # the Windows help compiler requires that css links + # don't have a query component + if self.name not in {'epub', 'htmlhelp'}: if checksum := _file_checksum(outdir, css.filename): uri += f'?v={checksum}' return f''