Patchwork D3726: hgweb: pass a sysstr to low-level _start_response method

login
register
mail settings
Submitter phabricator
Date June 13, 2018, 1:09 a.m.
Message ID <differential-rev-PHID-DREV-vlh7orakm3wvnigdfkus-req@phab.mercurial-scm.org>
Download mbox | patch
Permalink /patch/32102/
State Superseded
Headers show

Comments

phabricator - June 13, 2018, 1:09 a.m.
durin42 created this revision.
Herald added a subscriber: mercurial-devel.
Herald added a reviewer: hg-reviewers.

REVISION SUMMARY
  This fixes a regression in Python 3 support introduced in https://phab.mercurial-scm.org/rHG7de7bd407251af2bc98e5b809c8598ee95830daf
  on the stable branch. We're so early in do_hgweb that I don't see any
  especially better choices than this.

REPOSITORY
  rHG Mercurial

REVISION DETAIL
  https://phab.mercurial-scm.org/D3726

AFFECTED FILES
  mercurial/hgweb/server.py

CHANGE DETAILS




To: durin42, #hg-reviewers
Cc: mercurial-devel

Patch

diff --git a/mercurial/hgweb/server.py b/mercurial/hgweb/server.py
--- a/mercurial/hgweb/server.py
+++ b/mercurial/hgweb/server.py
@@ -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