Bug 1368341 - Fixup handling of file urls in mozharness, r=ahal

MozReview-Commit-ID: 7BpUFLZttsh

--HG--
extra : rebase_source : c1872911812628d97d8516916c44d36558e30b52
This commit is contained in:
James Graham 2017-05-25 14:08:03 +01:00
parent ba40cb0a5c
commit ab3298c9c4

View File

@ -369,10 +369,11 @@ class ScriptMixin(PlatformMixin):
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 == '':