changeset 34701:6db536bed7ec

httppeer: use native strings for headers On Python 3, we need to use unicodes, rather than bytes. This lets test-pull.t get a lot further along. Differential Revision: https://phab.mercurial-scm.org/D887
author Augie Fackler <augie@google.com>
date Sun, 01 Oct 2017 12:12:34 -0400
parents 8e5132ece156
children b2316265a32e
files mercurial/httppeer.py
diffstat 1 files changed, 6 insertions(+), 6 deletions(-) [+]
line wrap: on
line diff
--- a/mercurial/httppeer.py	Thu Oct 05 14:29:51 2017 -0400
+++ b/mercurial/httppeer.py	Sun Oct 01 12:12:34 2017 -0400
@@ -221,7 +221,7 @@
                 argsio = io.BytesIO(strargs)
                 argsio.length = len(strargs)
                 data = _multifile(argsio, data)
-            headers['X-HgArgs-Post'] = len(strargs)
+            headers[r'X-HgArgs-Post'] = len(strargs)
         else:
             if len(args) > 0:
                 httpheader = self.capable('httpheader')
@@ -244,10 +244,10 @@
         elif data is not None:
             size = len(data)
         if size and self.ui.configbool('ui', 'usehttp2'):
-            headers['Expect'] = '100-Continue'
-            headers['X-HgHttp2'] = '1'
-        if data is not None and 'Content-Type' not in headers:
-            headers['Content-Type'] = 'application/mercurial-0.1'
+            headers[r'Expect'] = r'100-Continue'
+            headers[r'X-HgHttp2'] = r'1'
+        if data is not None and r'Content-Type' not in headers:
+            headers[r'Content-Type'] = r'application/mercurial-0.1'
 
         # Tell the server we accept application/mercurial-0.2 and multiple
         # compression formats if the server is capable of emitting those
@@ -281,7 +281,7 @@
                 varyheaders.append(header)
 
         if varyheaders:
-            headers['Vary'] = ','.join(varyheaders)
+            headers[r'Vary'] = r','.join(varyheaders)
 
         req = self._requestbuilder(pycompat.strurl(cu), data, headers)