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

durin42 (Augie Fackler) phabricator at mercurial-scm.org
Fri Mar 2 11:18:32 EST 2018


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

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')



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


More information about the Mercurial-devel mailing list