# HG changeset patch # User Augie Fackler # Date 1533885362 14400 # Node ID 1419ba5e3b560fbd6d06ad531d4e530700ad163a # Parent efeeb73f54c3fcd316755740d3a253930ff3754b stringutil: if we get a memoryview in escapestr, coerce it to bytes Otherwise we get an exception. Sadly, this manifesting deep inside the wireproto code, inside a future. For some reason the exception was /causing a hang/ rather than actually propagating out, which seems like it might merit some investigation in the future. Differential Revision: https://phab.mercurial-scm.org/D4256 diff -r efeeb73f54c3 -r 1419ba5e3b56 mercurial/utils/stringutil.py --- a/mercurial/utils/stringutil.py Fri Aug 10 03:14:52 2018 -0400 +++ b/mercurial/utils/stringutil.py Fri Aug 10 03:16:02 2018 -0400 @@ -427,6 +427,8 @@ return encoding.trim(text, maxlength, ellipsis='...') def escapestr(s): + if isinstance(s, memoryview): + s = bytes(s) # call underlying function of s.encode('string_escape') directly for # Python 3 compatibility return codecs.escape_encode(s)[0]