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 409413 0c4c63d70d4290205431d3ac7f23ce7e12749b66
parent 409412 c9d839d793c61078b9c953ad6bee96df8269bde8
child 409414 c6fb400017f150d652c0b2b01f8d619f58c82931
push id7391
push usermtabara@mozilla.com
push dateMon, 12 Jun 2017 13:08:53 +0000
treeherdermozilla-beta@2191d7f87e2e [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: