# HG changeset patch # User Mads Kiilerich # Date 2026-01-06 20:44:44 # Node ID 77aa8e4cd0a269cd003443d76c79b7e735593e8c # Parent 335f7f13b934c05bda53dc45831ddd5069735327 helpers: very partial support for pygments >= 2.12 setup.py makes it clear that Kallithea only supports "Pygments >= 2.2.0, < 2.8". Later versions are known to cause minor breakage to tests, and it hasn't been validated that they don't expose other problems. Pawel (aka momat) reported a problem with pygments >= 2.12 when subclassing HtmlFormatter. The wrap outfile parameter has been dropped, and he suggested this workaround. The workaround seems safe and backwards compatible and nice to have, but we still don't recommend or support using Pygments >= 2.8 . diff --git a/kallithea/lib/helpers.py b/kallithea/lib/helpers.py --- a/kallithea/lib/helpers.py +++ b/kallithea/lib/helpers.py @@ -162,7 +162,7 @@ class CodeHtmlFormatter(HtmlFormatter): My code Html Formatter for source codes """ - def wrap(self, source, outfile): + def wrap(self, source, outfile=None): return self._wrap_div(self._wrap_pre(self._wrap_code(source))) def _wrap_code(self, source):