changeset 39892:b55747ca518f

py3: ensure printing to stdout uses str in test-hgweb-no-request-uri.t
author Matt Harbison <matt_harbison@yahoo.com>
date Thu, 27 Sep 2018 22:07:12 -0400
parents b99903534e06
children f6874567a93b
files tests/test-hgweb-no-request-uri.t
diffstat 1 files changed, 4 insertions(+), 3 deletions(-) [+]
line wrap: on
line diff
--- 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'] = '/'