Show More
@@ -162,11 +162,11 b' def parserequestfromenv(env, reponame=No' | |||||
162 | # strings on Python 3 must be between \00000-\000FF. We deal with bytes |
|
162 | # strings on Python 3 must be between \00000-\000FF. We deal with bytes | |
163 | # in Mercurial, so mass convert string keys and values to bytes. |
|
163 | # in Mercurial, so mass convert string keys and values to bytes. | |
164 | if pycompat.ispy3: |
|
164 | if pycompat.ispy3: | |
165 | env = {k.encode('latin-1'): v for k, v in pycompat.iteritems(env)} |
|
165 | def tobytes(s): | |
166 | env = { |
|
166 | if not isinstance(s, str): | |
167 | k: v.encode('latin-1') if isinstance(v, str) else v |
|
167 | return s | |
168 | for k, v in pycompat.iteritems(env) |
|
168 | return s.encode('latin-1') | |
169 | } |
|
169 | env = {tobytes(k): tobytes(v) for k, v in pycompat.iteritems(env)} | |
170 |
|
170 | |||
171 | # Some hosting solutions are emulating hgwebdir, and dispatching directly |
|
171 | # Some hosting solutions are emulating hgwebdir, and dispatching directly | |
172 | # to an hgweb instance using this environment variable. This was always |
|
172 | # to an hgweb instance using this environment variable. This was always |
General Comments 0
You need to be logged in to leave comments.
Login now