tests: use inline Python instead of sed to add trailing whitespace
The sed invocation was failing on OS X and FreeBSD. I'm far too lazy
to diagnose that, so just use some inline Python to fix the build.
context: add missing b prefix
This fixes
mercurial/context.py:593: SyntaxError: cannot mix bytes and nonbytes literals (context.py, line 593)
in Python 3.
doctest: convert matcher root to native path
Otherwise it wouldn't be caught by a fast path of pathutil.canonpath(), and
fall back to file identity checks.