##// END OF EJS Templates
statichttprepo: use str to appease Python 3...
Gregory Szorc -
r41452:6e9bebb6 default
parent child Browse files
Show More
@@ -19,6 +19,7 b' from . import ('
19 manifest,
19 manifest,
20 namespaces,
20 namespaces,
21 pathutil,
21 pathutil,
22 pycompat,
22 url,
23 url,
23 util,
24 util,
24 vfs as vfsmod,
25 vfs as vfsmod,
@@ -44,12 +45,12 b' class httprangereader(object):'
44 def seek(self, pos):
45 def seek(self, pos):
45 self.pos = pos
46 self.pos = pos
46 def read(self, bytes=None):
47 def read(self, bytes=None):
47 req = urlreq.request(self.url)
48 req = urlreq.request(pycompat.strurl(self.url))
48 end = ''
49 end = ''
49 if bytes:
50 if bytes:
50 end = self.pos + bytes - 1
51 end = self.pos + bytes - 1
51 if self.pos or end:
52 if self.pos or end:
52 req.add_header('Range', 'bytes=%d-%s' % (self.pos, end))
53 req.add_header(r'Range', r'bytes=%d-%s' % (self.pos, end))
53
54
54 try:
55 try:
55 f = self.opener.open(req)
56 f = self.opener.open(req)
General Comments 0
You need to be logged in to leave comments. Login now