changeset 38308:9f499d28efb4

hgweb: pass a sysstr to low-level _start_response method This fixes a regression in Python 3 support introduced in 7de7bd407251 on the stable branch. We're so early in do_hgweb that I don't see any especially better choices than this. Differential Revision: https://phab.mercurial-scm.org/D3726
author Augie Fackler <augie@google.com>
date Tue, 12 Jun 2018 20:42:42 -0400
parents 42f3a277c8dc
children af0e88e64ede
files mercurial/hgweb/server.py
diffstat 1 files changed, 3 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/mercurial/hgweb/server.py	Tue Jun 12 18:49:35 2018 -0400
+++ b/mercurial/hgweb/server.py	Tue Jun 12 20:42:42 2018 -0400
@@ -125,8 +125,9 @@
         # Ensure the slicing of path below is valid
         if (path != self.server.prefix
             and not path.startswith(self.server.prefix + b'/')):
-            self._start_response(common.statusmessage(404), [])
-            self._write("Not Found")
+            self._start_response(pycompat.strurl(common.statusmessage(404)),
+                                 [])
+            self._write(b"Not Found")
             self._done()
             return