D10204: wsgicgi: switch the default PATH_INFO back to str

mharbison72 (Matt Harbison) phabricator at mercurial-scm.org
Sat Mar 13 19:33:37 UTC 2021


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

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']



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


More information about the Mercurial-devel mailing list