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

Matt Harbison mharbison72 at gmail.com
Fri Sep 28 04:38:59 UTC 2018


# 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

diff --git a/tests/test-hgweb-no-request-uri.t b/tests/test-hgweb-no-request-uri.t
--- a/tests/test-hgweb-no-request-uri.t
+++ b/tests/test-hgweb-no-request-uri.t
@@ -23,6 +23,7 @@ should be used from d74fc8dec2b4 onward 
   >     hgwebdir,
   > )
   > from mercurial import (
+  >     encoding,
   >     util,
   > )
   > stringio = util.stringio
@@ -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)))
   >     getattr(content, 'close', lambda : None)()
   >     print('---- ERRORS')
-  >     print(errors.getvalue())
+  >     print(encoding.strfromlocal(errors.getvalue())) # avoid b'' output diff
   > 
   > output = stringio()
   > env['PATH_INFO'] = '/'


More information about the Mercurial-devel mailing list