diff mercurial/hgweb/server.py @ 41452:52a4a3e7cc6a

py3: force hgweb.server error log to internally write unicode Otherwise, there's a lot of py2/py3 divergence in the LFS tests because of the "HG error" lines picking up a b'' prefix. wsgicgi.py uses procutil.stderr, so I assume the input was meant to be bytes.
author Matt Harbison <matt_harbison@yahoo.com>
date Sun, 27 Jan 2019 18:34:17 -0500
parents 4045ab21945a
children 9b2b8794f801
line wrap: on
line diff
--- a/mercurial/hgweb/server.py	Sun Jan 27 17:48:15 2019 -0500
+++ b/mercurial/hgweb/server.py	Sun Jan 27 18:34:17 2019 -0500
@@ -54,7 +54,7 @@
         self.writelines(str.split('\n'))
     def writelines(self, seq):
         for msg in seq:
-            self.handler.log_error("HG error:  %s", msg)
+            self.handler.log_error(r"HG error:  %s", encoding.strfromlocal(msg))
 
 class _httprequesthandler(httpservermod.basehttprequesthandler):