py3: force hgweb.server error log to internally write unicode
authorMatt Harbison <matt_harbison@yahoo.com>
Sun, 27 Jan 2019 18:34:17 -0500
changeset 41430 52a4a3e7cc6a
parent 41429 7df10ea7a5b8
child 41431 0b636d1720a0
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.
mercurial/hgweb/server.py
--- 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):