# HG changeset patch # User Gregory Szorc # Date 2018-09-25 03:10:01 # Node ID a6088d10d5f2e2e8a3676b4c44da04c472915ad7 # Parent c31ce080eb75fa379031e4ce3f1457f91770f180 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 diff --git a/mercurial/hgweb/server.py b/mercurial/hgweb/server.py --- a/mercurial/hgweb/server.py +++ b/mercurial/hgweb/server.py @@ -101,8 +101,8 @@ class _httprequesthandler(httpservermod. 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