diff mercurial/hgweb/hgwebdir_mod.py @ 37712:a728e3695325

hgwebdir: un-bytes the env dict before re-parsing env Not the most elegant, but it restores test-subrepo-deep-nested-change.t to passing on Python 3. Differential Revision: https://phab.mercurial-scm.org/D3367
author Augie Fackler <augie@google.com>
date Sat, 14 Apr 2018 01:12:55 -0400
parents 8a5ee6aa8870
children 877185de62cf
line wrap: on
line diff
--- a/mercurial/hgweb/hgwebdir_mod.py	Sat Apr 14 16:36:15 2018 -0700
+++ b/mercurial/hgweb/hgwebdir_mod.py	Sat Apr 14 01:12:55 2018 -0400
@@ -422,8 +422,12 @@
                 if real:
                     # Re-parse the WSGI environment to take into account our
                     # repository path component.
+                    uenv = req.rawenv
+                    if pycompat.ispy3:
+                        uenv = {k.decode('latin1'): v for k, v in
+                                uenv.iteritems()}
                     req = requestmod.parserequestfromenv(
-                        req.rawenv, reponame=virtualrepo,
+                        uenv, reponame=virtualrepo,
                         altbaseurl=self.ui.config('web', 'baseurl'))
                     try:
                         # ensure caller gets private copy of ui