From 1844318826513733b607f21d07885a963fef46d7 Mon Sep 17 00:00:00 2001 From: "mcgrathr@chromium.org" Date: Mon, 9 Jan 2012 22:38:27 +0000 Subject: srpcgen: Open output files as binary Opening the output files in binary mode ensures that they are always written with LF line-endings, never with CRLF on Windows. BUG= none TEST= none R=noelallen@google.com,noelallen@chromium.org,bradnelson@google.com Review URL: http://codereview.chromium.org/9161001 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@116936 0039d316-1c4b-4281-b951-d872f2087c98 --- ppapi/native_client/src/tools/srpcgen.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'ppapi') diff --git a/ppapi/native_client/src/tools/srpcgen.py b/ppapi/native_client/src/tools/srpcgen.py index 2a59b35..c74e2cc 100755 --- a/ppapi/native_client/src/tools/srpcgen.py +++ b/ppapi/native_client/src/tools/srpcgen.py @@ -412,12 +412,14 @@ def main(argv): # Get the name of the header file to be generated. h_file_name = pargs[2] MakePath(h_file_name) - h_file = open(h_file_name, 'w') + # Note we open output files in binary mode so that on Windows the files + # will always get LF line-endings rather than CRLF. + h_file = open(h_file_name, 'wb') # Get the name of the source file to be generated. Depending upon whether # -c or -s is generated, this file contains either client or server methods. cc_file_name = pargs[3] MakePath(cc_file_name) - cc_file = open(cc_file_name, 'w') + cc_file = open(cc_file_name, 'wb') # The remaining arguments are the spec files to be compiled. spec_files = pargs[4:] -- cgit v1.1