D3326: py3: use str variables to check keys in request header

2018-04-13 Thread yuja (Yuya Nishihara)
yuja added a comment.


  Missing `**` ?
  
  
https://docs.python.org/2.7/library/httplib.html?highlight=putrequest#httplib.HTTPConnection.putrequest

REPOSITORY
  rHG Mercurial

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

To: pulkit, #hg-reviewers, durin42
Cc: yuja, mercurial-devel
___
Mercurial-devel mailing list
Mercurial-devel@mercurial-scm.org
https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel


D3326: py3: use str variables to check keys in request header

2018-04-13 Thread pulkit (Pulkit Goyal)
This revision was automatically updated to reflect the committed changes.
Closed by commit rHG83250442dc81: py3: use str variables to check keys in 
request header (authored by pulkit, committed by ).

REPOSITORY
  rHG Mercurial

CHANGES SINCE LAST UPDATE
  https://phab.mercurial-scm.org/D3326?vs=8146&id=8201

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

AFFECTED FILES
  mercurial/keepalive.py

CHANGE DETAILS

diff --git a/mercurial/keepalive.py b/mercurial/keepalive.py
--- a/mercurial/keepalive.py
+++ b/mercurial/keepalive.py
@@ -318,24 +318,24 @@
 headers.update(sorted(req.unredirected_hdrs.items()))
 headers = util.sortdict((n.lower(), v) for n, v in headers.items())
 skipheaders = {}
-for n in ('host', 'accept-encoding'):
+for n in (r'host', r'accept-encoding'):
 if n in headers:
-skipheaders['skip_' + n.replace('-', '_')] = 1
+skipheaders[r'skip_' + n.replace(r'-', r'_')] = 1
 try:
 if urllibcompat.hasdata(req):
 data = urllibcompat.getdata(req)
 h.putrequest(
 req.get_method(), urllibcompat.getselector(req),
-**pycompat.strkwargs(skipheaders))
+skipheaders)
 if r'content-type' not in headers:
 h.putheader(r'Content-type',
 r'application/x-www-form-urlencoded')
 if r'content-length' not in headers:
 h.putheader(r'Content-length', r'%d' % len(data))
 else:
 h.putrequest(
 req.get_method(), urllibcompat.getselector(req),
-**pycompat.strkwargs(skipheaders))
+skipheaders)
 except socket.error as err:
 raise urlerr.urlerror(err)
 for k, v in headers.items():



To: pulkit, #hg-reviewers, durin42
Cc: mercurial-devel
___
Mercurial-devel mailing list
Mercurial-devel@mercurial-scm.org
https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel


D3326: py3: use str variables to check keys in request header

2018-04-13 Thread pulkit (Pulkit Goyal)
pulkit created this revision.
Herald added a subscriber: mercurial-devel.
Herald added a reviewer: hg-reviewers.

REVISION SUMMARY
  The values in header are of str type.

REPOSITORY
  rHG Mercurial

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

AFFECTED FILES
  mercurial/keepalive.py

CHANGE DETAILS

diff --git a/mercurial/keepalive.py b/mercurial/keepalive.py
--- a/mercurial/keepalive.py
+++ b/mercurial/keepalive.py
@@ -318,24 +318,24 @@
 headers.update(sorted(req.unredirected_hdrs.items()))
 headers = util.sortdict((n.lower(), v) for n, v in headers.items())
 skipheaders = {}
-for n in ('host', 'accept-encoding'):
+for n in (r'host', r'accept-encoding'):
 if n in headers:
-skipheaders['skip_' + n.replace('-', '_')] = 1
+skipheaders[r'skip_' + n.replace(r'-', r'_')] = 1
 try:
 if urllibcompat.hasdata(req):
 data = urllibcompat.getdata(req)
 h.putrequest(
 req.get_method(), urllibcompat.getselector(req),
-**pycompat.strkwargs(skipheaders))
+skipheaders)
 if r'content-type' not in headers:
 h.putheader(r'Content-type',
 r'application/x-www-form-urlencoded')
 if r'content-length' not in headers:
 h.putheader(r'Content-length', r'%d' % len(data))
 else:
 h.putrequest(
 req.get_method(), urllibcompat.getselector(req),
-**pycompat.strkwargs(skipheaders))
+skipheaders)
 except socket.error as err:
 raise urlerr.urlerror(err)
 for k, v in headers.items():



To: pulkit, #hg-reviewers
Cc: mercurial-devel
___
Mercurial-devel mailing list
Mercurial-devel@mercurial-scm.org
https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel