[PATCH] crecord: fix statup crash of curses UI

Laurent Charignon lcharignon at fb.com
Wed Mar 18 12:47:51 CDT 2015


# HG changeset patch
# User Laurent Charignon <lcharignon at fb.com>
# Date 1426700642 25200
#      Wed Mar 18 10:44:02 2015 -0700
# Node ID e236783e45df422cee4ec7f9732d35100b05fb0d
# Parent  365b6d3e8e5046ab0e538686dd8cf25f73efa039
crecord: fix statup crash of curses UI

Introduced by 7d5f935bd705, not caught by the tests as they don't cover the UI
code

diff --git a/mercurial/crecord.py b/mercurial/crecord.py
--- a/mercurial/crecord.py
+++ b/mercurial/crecord.py
@@ -872,7 +872,7 @@
         width = self.xscreensize
         # turn tabs into spaces
         instr = instr.expandtabs(4)
-        strwidth = encoding.ucolwidth(instr)
+        strwidth = encoding.ucolwidth(unicode(instr))
         numspaces = (width - ((strwidth + xstart) % width) - 1)
         return instr + " " * numspaces + "\n"
 


More information about the Mercurial-devel mailing list