changeset 39832:a6088d10d5f2

py3: ensure _start_response() is called with system string This was preventing HTTP 500's from being sent in Python 3. Differential Revision: https://phab.mercurial-scm.org/D4730
author Gregory Szorc <gregory.szorc@gmail.com>
date Mon, 24 Sep 2018 20:10:01 -0700
parents c31ce080eb75
children 3ed53b071041
files mercurial/hgweb/server.py
diffstat 1 files changed, 2 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/mercurial/hgweb/server.py	Sun Sep 23 00:47:04 2018 -0400
+++ b/mercurial/hgweb/server.py	Mon Sep 24 20:10:01 2018 -0700
@@ -101,8 +101,8 @@
         try:
             self.do_write()
         except Exception:
-            self._start_response("500 Internal Server Error", [])
-            self._write("Internal Server Error")
+            self._start_response(r"500 Internal Server Error", [])
+            self._write(b"Internal Server Error")
             self._done()
             tb = r"".join(traceback.format_exception(*sys.exc_info()))
             # We need a native-string newline to poke in the log