From c3d118a45e75ec8221b0c102b528ddd93656241d Mon Sep 17 00:00:00 2001 From: S Date: Mon, 15 Aug 2016 01:52:52 +0000 Subject: [PATCH 1/2] Fix error-prone message while bootstrapping --- python/servo/bootstrap_commands.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/python/servo/bootstrap_commands.py b/python/servo/bootstrap_commands.py index 13db36079ae..a3b997c2e69 100644 --- a/python/servo/bootstrap_commands.py +++ b/python/servo/bootstrap_commands.py @@ -70,7 +70,7 @@ def download(desc, src, writer, start_byte=0): "Please see https://github.com/servo/servo/#prerequisites") sys.exit(1) except urllib2.URLError, e: - print("Error downloading Rust compiler: " + str(e.reason) + ". The failing URL was: " + src) + print("Error downloading Rust compiler: %s. The failing URL was: %s" % (e.reason, src)) sys.exit(1) except KeyboardInterrupt: writer.flush() From 8e12e3ce682650393965844077f428928d9f0db0 Mon Sep 17 00:00:00 2001 From: S Date: Tue, 16 Aug 2016 04:06:41 +0000 Subject: [PATCH 2/2] Fix overriding url with Request obj. when resuming download --- python/servo/bootstrap_commands.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/python/servo/bootstrap_commands.py b/python/servo/bootstrap_commands.py index a3b997c2e69..bd074b41dec 100644 --- a/python/servo/bootstrap_commands.py +++ b/python/servo/bootstrap_commands.py @@ -37,9 +37,10 @@ def download(desc, src, writer, start_byte=0): dumb = (os.environ.get("TERM") == "dumb") or (not sys.stdout.isatty()) try: + req = urllib2.Request(src) if start_byte: - src = urllib2.Request(src, headers={'Range': 'bytes={}-'.format(start_byte)}) - resp = urllib2.urlopen(src) + req = urllib2.Request(src, headers={'Range': 'bytes={}-'.format(start_byte)}) + resp = urllib2.urlopen(req) fsize = None if resp.info().getheader('Content-Length'):