Change fixup_pdf_template.py to open files in binary mode.
authorLei Zhang <thestig@chromium.org>
Wed, 2 Sep 2015 23:31:33 +0000 (16:31 -0700)
committerLei Zhang <thestig@chromium.org>
Wed, 2 Sep 2015 23:31:33 +0000 (16:31 -0700)
Fix for the pixel test failure on Windows from commit 870b5b6793fa.
Seems to work for me on Windows.

TBR=tsepez@chromium.org

Review URL: https://codereview.chromium.org/1312493006 .

testing/tools/fixup_pdf_template.py

index a43db55..80a712f 100755 (executable)
@@ -74,8 +74,8 @@ class TemplateProcessor:
 def expand_file(input_path, output_path):
   processor = TemplateProcessor()
   try:
-    with open(input_path, 'r') as infile:
-      with open(output_path, 'w') as outfile:
+    with open(input_path, 'rb') as infile:
+      with open(output_path, 'wb') as outfile:
         for line in infile:
            outfile.write(processor.process_line(line))
   except IOError: