# HG changeset patch # User Matt Mackall # Date 2014-06-13 19:14:02 # Node ID 4c62478be2ea302b8f15fbb3644236f45a9ceec4 # Parent 395e29928db23da55d2ac42d44d146af2f6b8f7b minirst: explicitly decode substitutions Caught by Augie and sys.setdefaultencoding("undefined") diff --git a/mercurial/minirst.py b/mercurial/minirst.py --- a/mercurial/minirst.py +++ b/mercurial/minirst.py @@ -56,7 +56,7 @@ def replace(text, substs): # on strings in local encoding causes invalid byte sequences. utext = text.decode(encoding.encoding) for f, t in substs: - utext = utext.replace(f, t) + utext = utext.replace(f.decode("ascii"), t.decode("ascii")) return utext.encode(encoding.encoding) _blockre = re.compile(r"\n(?:\s*\n)+")