Bug 1368341 - Fixup handling of file urls in mozharness, r=ahal
authorJames Graham <james@hoppipolla.co.uk>
Thu, 25 May 2017 14:08:03 +0100
changeset 361296 0c4c63d70d4290205431d3ac7f23ce7e12749b66
parent 361295 c9d839d793c61078b9c953ad6bee96df8269bde8
child 361297 c6fb400017f150d652c0b2b01f8d619f58c82931
push id31924
push userryanvm@gmail.com
push dateTue, 30 May 2017 20:08:50 +0000
treeherdermozilla-central@692e277e2b9f [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersahal
bugs1368341
milestone55.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1368341 - Fixup handling of file urls in mozharness, r=ahal MozReview-Commit-ID: 7BpUFLZttsh
testing/mozharness/mozharness/base/script.py
--- a/testing/mozharness/mozharness/base/script.py
+++ b/testing/mozharness/mozharness/base/script.py
@@ -364,20 +364,21 @@ class ScriptMixin(PlatformMixin):
 
         Returns:
             BytesIO: contents of url
         '''
         self.info('Fetch {} into memory'.format(url))
         parsed_url = urlparse.urlparse(url)
 
         if parsed_url.scheme in ('', 'file'):
-            if not os.path.isfile(url):
+            path = parsed_url.path
+            if not os.path.isfile(path):
                 raise IOError('Could not find file to extract: {}'.format(url))
 
-            content_length = os.stat(url.replace('file://', '')).st_size
+            content_length = os.stat(path).st_size
 
             # In case we're referrencing a file without file://
             if parsed_url.scheme == '':
                 url = 'file://%s' % os.path.abspath(url)
                 parsed_url = urlparse.urlparse(url)
 
         request = urllib2.Request(url)
         # When calling fetch_url_into_memory() you should retry when we raise one of these exceptions: