Patchwork D10204: wsgicgi: switch the default PATH_INFO back to str

login
register
mail settings
Submitter phabricator
Date March 13, 2021, 7:33 p.m.
Message ID <differential-rev-PHID-DREV-37cpu4npnsmu4qusuwsn-req@mercurial-scm.org>
Download mbox | patch
Permalink /patch/48517/
State Superseded
Headers show

Comments

phabricator - March 13, 2021, 7:33 p.m.
mharbison72 created this revision.
Herald added a reviewer: hg-reviewers.
Herald added a subscriber: mercurial-patches.

REVISION SUMMARY
  It looks like everything here is meant to be str, and regressed in 687b865b95ad <https://phab.mercurial-scm.org/rHG687b865b95add1fb486e556ab3afc9321f3f298c>.
  Pytype didn't flag this, but is really confused about the range of possible
  types for the dictionary values, and flagged missing `lower()` on various types
  in this area.

REPOSITORY
  rHG Mercurial

BRANCH
  stable

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

AFFECTED FILES
  mercurial/hgweb/wsgicgi.py

CHANGE DETAILS




To: mharbison72, #hg-reviewers
Cc: mercurial-patches, mercurial-devel

Patch

diff --git a/mercurial/hgweb/wsgicgi.py b/mercurial/hgweb/wsgicgi.py
--- a/mercurial/hgweb/wsgicgi.py
+++ b/mercurial/hgweb/wsgicgi.py
@@ -25,7 +25,7 @@ 
     procutil.setbinary(procutil.stdout)
 
     environ = dict(pycompat.iteritems(os.environ))  # re-exports
-    environ.setdefault('PATH_INFO', b'')
+    environ.setdefault('PATH_INFO', '')
     if environ.get('SERVER_SOFTWARE', '').startswith('Microsoft-IIS'):
         # IIS includes script_name in PATH_INFO
         scriptname = environ['SCRIPT_NAME']