bug 1416891 - Open output files in binary mode for GENERATED_FILES. r?build draft
authorTed Mielczarek <ted@mielczarek.org>
Thu, 30 Nov 2017 11:32:29 -0500
changeset 705778 693c8932e202f297763143b0d7f64d4e4ab9b0dd
parent 705777 4de0da803df5d2dc92c04217b245a1327a922dbe
child 742452 7f6deba7ad5538e34544dc5da4b9f88afbeca92c
push id91576
push userbmo:ted@mielczarek.org
push dateThu, 30 Nov 2017 16:56:58 +0000
reviewersbuild
bugs1416891
milestone59.0a1
bug 1416891 - Open output files in binary mode for GENERATED_FILES. r?build MozReview-Commit-ID: 7rTUDtVGL82
python/mozbuild/mozbuild/action/file_generate.py
--- a/python/mozbuild/mozbuild/action/file_generate.py
+++ b/python/mozbuild/mozbuild/action/file_generate.py
@@ -59,17 +59,17 @@ def main(argv):
     method = args.method_name
     if not hasattr(module, method):
         print('Error: script "{0}" is missing a {1} method'.format(script, method),
               file=sys.stderr)
         return 1
 
     ret = 1
     try:
-        with FileAvoidWrite(args.output_file) as output:
+        with FileAvoidWrite(args.output_file, mode='rb') as output:
             ret = module.__dict__[method](output, *args.additional_arguments, **kwargs)
             # The following values indicate a statement of success:
             #  - a set() (see below)
             #  - 0
             #  - False
             #  - None
             #
             # Everything else is an error (so scripts can conveniently |return