Mercurial > hg-stable
comparison mercurial/hgweb/server.py @ 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 | b263133eeb5a |
children | d1e0b905c59d |
comparison
equal
deleted
inserted
replaced
39831:c31ce080eb75 | 39832:a6088d10d5f2 |
---|---|
99 | 99 |
100 def do_POST(self): | 100 def do_POST(self): |
101 try: | 101 try: |
102 self.do_write() | 102 self.do_write() |
103 except Exception: | 103 except Exception: |
104 self._start_response("500 Internal Server Error", []) | 104 self._start_response(r"500 Internal Server Error", []) |
105 self._write("Internal Server Error") | 105 self._write(b"Internal Server Error") |
106 self._done() | 106 self._done() |
107 tb = r"".join(traceback.format_exception(*sys.exc_info())) | 107 tb = r"".join(traceback.format_exception(*sys.exc_info())) |
108 # We need a native-string newline to poke in the log | 108 # We need a native-string newline to poke in the log |
109 # message, because we won't get a newline when using an | 109 # message, because we won't get a newline when using an |
110 # r-string. This is the easy way out. | 110 # r-string. This is the easy way out. |