D3367: hgwebdir: un-bytes the env dict before re-parsing env

durin42 (Augie Fackler) phabricator at mercurial-scm.org
Sat Apr 14 05:13:11 UTC 2018


durin42 created this revision.
Herald added a subscriber: mercurial-devel.
Herald added a reviewer: hg-reviewers.

REVISION SUMMARY
  Not the most elegant, but it restores
  test-subrepo-deep-nested-change.t to passing on Python 3.

REPOSITORY
  rHG Mercurial

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

AFFECTED FILES
  mercurial/hgweb/hgwebdir_mod.py

CHANGE DETAILS

diff --git a/mercurial/hgweb/hgwebdir_mod.py b/mercurial/hgweb/hgwebdir_mod.py
--- a/mercurial/hgweb/hgwebdir_mod.py
+++ b/mercurial/hgweb/hgwebdir_mod.py
@@ -422,8 +422,10 @@
                 if real:
                     # Re-parse the WSGI environment to take into account our
                     # repository path component.
+                    uenv = {k.decode('latin1'): v for k, v in
+                            req.rawenv.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



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


More information about the Mercurial-devel mailing list