D965: templatefilters: be sure we always feed cgi.escape a str

durin42 (Augie Fackler) phabricator at mercurial-scm.org
Sun Oct 8 04:38:06 EDT 2017


This revision was automatically updated to reflect the committed changes.
Closed by commit rHG4296bbb19410: templatefilters: be sure we always feed cgi.escape a str (authored by durin42, committed by ).

REPOSITORY
  rHG Mercurial

CHANGES SINCE LAST UPDATE
  https://phab.mercurial-scm.org/D965?vs=2481&id=2527

REVISION DETAIL
  https://phab.mercurial-scm.org/D965

AFFECTED FILES
  mercurial/templatefilters.py

CHANGE DETAILS

diff --git a/mercurial/templatefilters.py b/mercurial/templatefilters.py
--- a/mercurial/templatefilters.py
+++ b/mercurial/templatefilters.py
@@ -128,7 +128,8 @@
     """Any text. Replaces the special XML/XHTML characters "&", "<"
     and ">" with XML entities, and filters out NUL characters.
     """
-    return cgi.escape(text.replace('\0', ''), True)
+    return pycompat.sysbytes(
+        cgi.escape(pycompat.sysstr(text.replace('\0', '')), True))
 
 para_re = None
 space_re = None



To: durin42, #hg-reviewers, pulkit, indygreg, yuja
Cc: yuja, indygreg, pulkit, mercurial-devel


More information about the Mercurial-devel mailing list