# HG changeset patch # User Pierre-Yves David # Date 2023-09-01 10:09:54 # Node ID 98b8836d0e8204f726add05e9bc5eaa8d18055e4 # Parent d8c8a923ee9b38e36c8b0cc1b7fb95316b942cca hgweb: use sysstr to set attribute on diff option Attribute identifier should be `str` not `bytes`. diff --git a/mercurial/hgweb/webutil.py b/mercurial/hgweb/webutil.py --- a/mercurial/hgweb/webutil.py +++ b/mercurial/hgweb/webutil.py @@ -230,16 +230,16 @@ def difffeatureopts(req, ui, section): ui, untrusted=True, section=section, whitespace=True ) - for k in ( - b'ignorews', - b'ignorewsamount', - b'ignorewseol', - b'ignoreblanklines', + for kb, ks in ( + (b'ignorews', 'ignorews'), + (b'ignorewsamount', 'ignorewsamount'), + (b'ignorewseol', 'ignorewseol'), + (b'ignoreblanklines', 'ignoreblanklines'), ): - v = req.qsparams.get(k) + v = req.qsparams.get(kb) if v is not None: v = stringutil.parsebool(v) - setattr(diffopts, k, v if v is not None else True) + setattr(diffopts, ks, v if v is not None else True) return diffopts