Patchwork D2313: httppeer: headers are native strings

login
register
mail settings
Submitter phabricator
Date Feb. 18, 2018, 4:24 p.m.
Message ID <8ab4dd9ddb35d6f99b0493a8fe10b7df@localhost.localdomain>
Download mbox | patch
Permalink /patch/28108/
State Not Applicable
Headers show

Comments

phabricator - Feb. 18, 2018, 4:24 p.m.
This revision was automatically updated to reflect the committed changes.
Closed by commit rHGa59ff82154b8: httppeer: headers are native strings (authored by durin42, committed by ).

REPOSITORY
  rHG Mercurial

CHANGES SINCE LAST UPDATE
  https://phab.mercurial-scm.org/D2313?vs=5831&id=5882

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

AFFECTED FILES
  mercurial/httppeer.py

CHANGE DETAILS




To: durin42, #hg-reviewers, indygreg
Cc: pulkit, mercurial-devel

Patch

diff --git a/mercurial/httppeer.py b/mercurial/httppeer.py
--- a/mercurial/httppeer.py
+++ b/mercurial/httppeer.py
@@ -335,7 +335,7 @@ 
 
         if data is not None:
             self.ui.debug("sending %d bytes\n" % size)
-            req.add_unredirected_header('Content-Length', '%d' % size)
+            req.add_unredirected_header(r'Content-Length', r'%d' % size)
         try:
             resp = self._openurl(req)
         except urlerr.httperror as inst:
@@ -434,7 +434,7 @@ 
 
         tempname = bundle2.writebundle(self.ui, cg, None, type)
         fp = httpconnection.httpsendfile(self.ui, tempname, "rb")
-        headers = {'Content-Type': 'application/mercurial-0.1'}
+        headers = {r'Content-Type': r'application/mercurial-0.1'}
 
         try:
             r = self._call(cmd, data=fp, headers=headers, **args)
@@ -465,7 +465,7 @@ 
             fh.close()
             # start http push
             fp_ = httpconnection.httpsendfile(self.ui, filename, "rb")
-            headers = {'Content-Type': 'application/mercurial-0.1'}
+            headers = {r'Content-Type': r'application/mercurial-0.1'}
             return self._callstream(cmd, data=fp_, headers=headers, **args)
         finally:
             if fp_ is not None: