[PATCH] py3: ensure printing to stdout uses str in test-hgweb-no-request-uri.t

Yuya Nishihara yuya at tcha.org
Fri Sep 28 07:29:16 EDT 2018


On Fri, 28 Sep 2018 00:38:59 -0400, Matt Harbison wrote:
> # HG changeset patch
> # User Matt Harbison <matt_harbison at yahoo.com>
> # Date 1538100432 14400
> #      Thu Sep 27 22:07:12 2018 -0400
> # Node ID 777d233b5174c0ca9789080b52225247eb36bdec
> # Parent  591764c38fedebc1bd32d5454603888ca57c1656
> py3: ensure printing to stdout uses str in test-hgweb-no-request-uri.t

Queued, thanks.

> @@ -55,11 +56,11 @@ should be used from d74fc8dec2b4 onward 
>    > 
>    > def process(app):
>    >     content = app(env, startrsp)
> -  >     sys.stdout.write(output.getvalue())
> -  >     sys.stdout.write(''.join(content))
> +  >     sys.stdout.write(encoding.strfromlocal(output.getvalue()))
> +  >     sys.stdout.write(encoding.strfromlocal(b''.join(content)))

It's probably better to write directly to the underlying bytes stream (i.e.
sys.stdout.buffer), but I don't care as this is a test code.


More information about the Mercurial-devel mailing list