Bug 1306214 part 1 - Make mach devtools-css-db windows-compatible. r=tromey
authorXidorn Quan <me@upsuper.org>
Thu, 29 Sep 2016 17:44:04 +1000
changeset 315805 d0572bb7e28d0ed343d31659bc41b06e94e7714d
parent 315804 314075c09505c28c056f8f44f37acfd28342edca
child 315806 fde14639c02256ef7c214018478bb22ec91d5a48
push id20634
push usercbook@mozilla.com
push dateFri, 30 Sep 2016 10:10:13 +0000
treeherderfx-team@afe79b010d13 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerstromey
bugs1306214
milestone52.0a1
Bug 1306214 part 1 - Make mach devtools-css-db windows-compatible. r=tromey MozReview-Commit-ID: AmF1uAooikW
devtools/shared/css/generated/mach_commands.py
--- a/devtools/shared/css/generated/mach_commands.py
+++ b/devtools/shared/css/generated/mach_commands.py
@@ -107,18 +107,18 @@ class MachCommands(MachCommandBase):
 
     def output_template(self, substitutions):
         """Output a the properties-db.js from a template."""
         js_template_path = resolve_path(self.topsrcdir,
             'devtools/shared/css/generated/properties-db.js.in')
         destination_path = resolve_path(self.topsrcdir,
             'devtools/shared/css/generated/properties-db.js')
 
-        with open(js_template_path, 'r') as handle:
+        with open(js_template_path, 'rb') as handle:
             js_template = handle.read()
 
         preamble = '/* THIS IS AN AUTOGENERATED FILE.  DO NOT EDIT */\n\n'
         contents = string.Template(js_template).substitute(substitutions)
 
-        with open(destination_path, 'w') as destination:
+        with open(destination_path, 'wb') as destination:
             destination.write(preamble + contents)
 
         print('The database was successfully generated at ' + destination_path)