Bug 1597129 - fix newline usage for manifest writing in mach addtest, r=ahal
authorGijs Kruitbosch <gijskruitbosch@gmail.com>
Mon, 18 Nov 2019 21:12:22 +0000
changeset 502482 7f64e4879257aefc6450321a66532576ca29079b
parent 502481 93c199bb39288eb84cec5d26723a400263000f59
child 502483 582c1acfb3483e087316793a965497b9dfdbc208
push id114172
push userdluca@mozilla.com
push dateTue, 19 Nov 2019 11:31:10 +0000
treeherdermozilla-inbound@b5c5ba07d3db [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersahal
bugs1597129
milestone72.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1597129 - fix newline usage for manifest writing in mach addtest, r=ahal Differential Revision: https://phabricator.services.mozilla.com/D53353
testing/addtest.py
--- a/testing/addtest.py
+++ b/testing/addtest.py
@@ -1,11 +1,12 @@
 
 from __future__ import absolute_import, unicode_literals, print_function
 
+import io
 import os
 import manifestparser
 
 
 class Creator(object):
     def __init__(self, topsrcdir, test, suite, doc, **kwargs):
         self.topsrcdir = topsrcdir
         self.test = test
@@ -305,17 +306,17 @@ def write_to_ini_file(manifest_file, fil
         contents.append(filename)
     else:
         insert_before = '[{}]'.format(insert_before)
         for i in range(len(contents)):
             if contents[i].startswith(insert_before):
                 contents.insert(i, filename)
                 break
 
-    with open(manifest_file, "w") as f:
+    with io.open(manifest_file, "w", newline='\n') as f:
         f.write("".join(contents))
 
 
 TEST_CREATORS = {"mochitest": MochitestCreator,
                  "web-platform-tests": WebPlatformTestsCreator,
                  "xpcshell": XpcshellCreator}