Bug 1306214 part 1 - Make mach devtools-css-db windows-compatible. r=tromey draft
authorXidorn Quan <me@upsuper.org>
Thu, 29 Sep 2016 17:44:04 +1000
changeset 419195 c44415f0470b732d598eede2bbcc7335727c006e
parent 418918 fba71e92cf7d23728a7c963ae12027e7aee7e986
child 419196 4ec0f6430ba522daf62fda33858c922ac6a66bd7
push id30885
push userxquan@mozilla.com
push dateThu, 29 Sep 2016 23:24:54 +0000
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)