changeset 34429:0ee9cf8d054a

url: use native strings for header values Differential Revision: https://phab.mercurial-scm.org/D889
author Augie Fackler <augie@google.com>
date Sun, 01 Oct 2017 12:16:34 -0400
parents a454123f5d94
children b332c01247d8
files mercurial/url.py
diffstat 1 files changed, 3 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/mercurial/url.py	Sun Oct 01 12:15:53 2017 -0400
+++ b/mercurial/url.py	Sun Oct 01 12:16:34 2017 -0400
@@ -19,6 +19,7 @@
     error,
     httpconnection as httpconnectionmod,
     keepalive,
+    pycompat,
     sslutil,
     util,
 )
@@ -495,13 +496,13 @@
     # agent string for anything, clients should be able to define whatever
     # user agent they deem appropriate.
     agent = 'mercurial/proto-1.0 (Mercurial %s)' % util.version()
-    opener.addheaders = [('User-agent', agent)]
+    opener.addheaders = [(r'User-agent', pycompat.sysstr(agent))]
 
     # This header should only be needed by wire protocol requests. But it has
     # been sent on all requests since forever. We keep sending it for backwards
     # compatibility reasons. Modern versions of the wire protocol use
     # X-HgProto-<N> for advertising client support.
-    opener.addheaders.append(('Accept', 'application/mercurial-0.1'))
+    opener.addheaders.append((r'Accept', r'application/mercurial-0.1'))
     return opener
 
 def open(ui, url_, data=None):