# HG changeset patch # User Gregory Szorc # Date 2019-01-26 18:57:17 # Node ID 6e9bebb65ce7bb4def7f625eb7ac5724e30ba2e6 # Parent 2bf689b13a17fceecfc6318e6ff42b2b623bd17b statichttprepo: use str to appease Python 3 The URL fed into urllib and HTTP headers need to be str on Python 3. Differential Revision: https://phab.mercurial-scm.org/D5716 diff --git a/mercurial/statichttprepo.py b/mercurial/statichttprepo.py --- a/mercurial/statichttprepo.py +++ b/mercurial/statichttprepo.py @@ -19,6 +19,7 @@ from . import ( manifest, namespaces, pathutil, + pycompat, url, util, vfs as vfsmod, @@ -44,12 +45,12 @@ class httprangereader(object): def seek(self, pos): self.pos = pos def read(self, bytes=None): - req = urlreq.request(self.url) + req = urlreq.request(pycompat.strurl(self.url)) end = '' if bytes: end = self.pos + bytes - 1 if self.pos or end: - req.add_header('Range', 'bytes=%d-%s' % (self.pos, end)) + req.add_header(r'Range', r'bytes=%d-%s' % (self.pos, end)) try: f = self.opener.open(req)