Patchwork D2538: templatefilters: convert arguments to sysstrs for unicode() ctor

login
register
mail settings
Submitter phabricator
Date March 2, 2018, 4:18 p.m.
Message ID <1f966364ddfc668448b54d7cf213d245@localhost.localdomain>
Download mbox | patch
Permalink /patch/28688/
State Not Applicable
Headers show

Comments

phabricator - March 2, 2018, 4:18 p.m.
This revision was automatically updated to reflect the committed changes.
Closed by commit rHG9d71bd25554b: templatefilters: convert arguments to sysstrs for unicode() ctor (authored by durin42, committed by ).

REPOSITORY
  rHG Mercurial

CHANGES SINCE LAST UPDATE
  https://phab.mercurial-scm.org/D2538?vs=6328&id=6352

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

AFFECTED FILES
  mercurial/templatefilters.py

CHANGE DETAILS




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

Patch

diff --git a/mercurial/templatefilters.py b/mercurial/templatefilters.py
--- a/mercurial/templatefilters.py
+++ b/mercurial/templatefilters.py
@@ -273,7 +273,7 @@ 
     """Any text. Returns the input text rendered as a sequence of
     XML entities.
     """
-    text = unicode(text, encoding.encoding, 'replace')
+    text = unicode(text, pycompat.sysstr(encoding.encoding), r'replace')
     return ''.join(['&#%d;' % ord(c) for c in text])
 
 @templatefilter('permissions')