mercurial/debugcommands.py
changeset 39955 c421c22d3ad2
parent 39884 9c8eff5cfa1b
child 39956 36e9d2c60837
--- a/mercurial/debugcommands.py	Mon Oct 01 23:12:42 2018 -0700
+++ b/mercurial/debugcommands.py	Mon Oct 01 23:08:04 2018 -0700
@@ -3286,7 +3286,10 @@
                 line = line.lstrip()
                 m = re.match(b'^([a-zA-Z0-9_-]+): (.*)$', line)
                 if m:
-                    headers[m.group(1)] = m.group(2)
+                    # Headers need to use native strings.
+                    key = pycompat.strurl(m.group(1))
+                    value = pycompat.strurl(m.group(2))
+                    headers[key] = value
                     continue
 
                 if line.startswith(b'BODYFILE '):