statprof: correctly always pass a str as the thread name
Caught by pytype.
Differential Revision: https://phab.mercurial-scm.org/D7259
py3: fix handling of ctrl keys in crecord (
issue6213)
The "keypressed" value in handlekeypressed() is a key name obtained by
curses's getkey(); this can be a multibyte string for special keys
like CTRL keys. Calling curses.unctrl() with such a value fails on
Python 3 with a TypeError as described in
issue6213. (On Python 2, this
does not crash, but I'm not sure the result is correct, though it does
no matter here.)
So instead of calling unctrl(), we compare "keypressed" with the
expected "^L" obtained by curses.ascii.ctrl("L").
py3: keep "keypressed" a native str in crecord
This will help in the next changeset by avoiding a decode step. Also,
the actual bytes conversion seems superfluous since values coming from
curses's getkey() will be a native string. As a consequence, we open the
"testcommands" file (used in test-interactive-curses.t) in text mode.