bug 1416891 - Open output files in binary mode for GENERATED_FILES. r?build
MozReview-Commit-ID: 7rTUDtVGL82
--- 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