Bug 1480431 - Make ifh a file object; r=tomprince
authorGregory Szorc <gps@mozilla.com>
Thu, 02 Aug 2018 16:22:46 +0000
changeset 429831 6c78bc9cc725971b805ce09ae1d144ff64688a3e
parent 429830 ebd853eb196e0fe92e03875be88c8c5a14c2ed08
child 429832 525db752c9be8372654076e934fbb97e2fb7ff21
push id67270
push usergszorc@mozilla.com
push dateThu, 02 Aug 2018 16:23:35 +0000
treeherderautoland@6c78bc9cc725 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerstomprince
bugs1480431
milestone63.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 1480431 - Make ifh a file object; r=tomprince Otherwise it can't be used as a context manager since it doesn't have __enter__ or __exit__. Differential Revision: https://phabricator.services.mozilla.com/D2672
taskcluster/scripts/misc/fetch-content
--- a/taskcluster/scripts/misc/fetch-content
+++ b/taskcluster/scripts/misc/fetch-content
@@ -185,17 +185,17 @@ def extract_archive(path, dest_dir, typ)
             ifh = path.open('rb')
         else:
             raise ValueError('unknown archive format for tar file: %s' % path)
 
         args = ['tar', 'xf', '-']
         pipe_stdin = True
     elif typ == 'zip':
         # unzip from stdin has wonky behavior. We don't use a pipe for it.
-        ifh = os.devnull
+        ifh = open(os.devnull, 'rb')
         args = ['unzip', str(path)]
         pipe_stdin = False
     else:
         raise ValueError('unknown archive format: %s' % path)
 
     log('Extracting %s to %s using %r' % (path, dest_dir, args))
     t0 = time.time()