From efd8100ef08b7328ac5424f51c14e77c409cd01e Mon Sep 17 00:00:00 2001 From: Ted Mielczarek Date: Thu, 30 Nov 2017 11:32:29 -0500 Subject: [PATCH] bug 1416891 - Open output files in binary mode for GENERATED_FILES. r=nalexander,gps The script behind GENERATED_FILES currently opens output files in text mode, which means that they wind up with CRLF line endings on Windows. With switching updater.ini to use LOCALIZED_GENERATED_FILES, this means that it will wind up with different line endings than it currently has. Changing this to use binary format means that we'll have LF line endings everywhere, which shouldn't harm anything on Windows as most of our generated files are source files anyway. MozReview-Commit-ID: 7rTUDtVGL82 --HG-- extra : rebase_source : 53a604c225477ad02e439b7b9ace587aefd0785a --- python/mozbuild/mozbuild/action/file_generate.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/python/mozbuild/mozbuild/action/file_generate.py b/python/mozbuild/mozbuild/action/file_generate.py index 68ad1cbbc799..18b44bcc489e 100644 --- a/python/mozbuild/mozbuild/action/file_generate.py +++ b/python/mozbuild/mozbuild/action/file_generate.py @@ -64,7 +64,7 @@ def main(argv): 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)