py3: ensure printing to stdout uses str in test-hgweb-no-request-uri.t
authorMatt Harbison <matt_harbison@yahoo.com>
Thu, 27 Sep 2018 22:07:12 -0400
changeset 39892 b55747ca518f
parent 39891 b99903534e06
child 39893 f6874567a93b
py3: ensure printing to stdout uses str in test-hgweb-no-request-uri.t
tests/test-hgweb-no-request-uri.t
--- a/tests/test-hgweb-no-request-uri.t	Thu Sep 27 13:57:50 2018 -0700
+++ b/tests/test-hgweb-no-request-uri.t	Thu Sep 27 22:07:12 2018 -0400
@@ -23,6 +23,7 @@
   >     hgwebdir,
   > )
   > from mercurial import (
+  >     encoding,
   >     util,
   > )
   > stringio = util.stringio
@@ -55,11 +56,11 @@
   > 
   > 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'] = '/'