Patchwork run-tests: write out scripts in binary mode

login
register
mail settings
Submitter Augie Fackler
Date March 13, 2014, 2:58 a.m.
Message ID <bc7e2f5d07e98d343ec0.1394679527@augie-macbookair.alto.octopoid.net>
Download mbox | patch
Permalink /patch/3933/
State Superseded
Commit 792ebd7dc5f64095d172f93e33eb1c9172ebbd6d
Headers show

Comments

Augie Fackler - March 13, 2014, 2:58 a.m.
# HG changeset patch
# User Augie Fackler <raf@durin42.com>
# Date 1383680855 18000
#      Tue Nov 05 14:47:35 2013 -0500
# Node ID bc7e2f5d07e98d343ec0751e5a44813ad7894415
# Parent  1cd5bff45db28150d7c140be493fe851e6560f27
run-tests: write out scripts in binary mode

Caught because Python 3 refuses to write bytes to a non-binary fd.
Matt Mackall - March 13, 2014, 4:26 a.m.
On Wed, 2014-03-12 at 22:58 -0400, Augie Fackler wrote:
> # HG changeset patch
> # User Augie Fackler <raf@durin42.com>
> # Date 1383680855 18000
> #      Tue Nov 05 14:47:35 2013 -0500
> # Node ID bc7e2f5d07e98d343ec0751e5a44813ad7894415
> # Parent  1cd5bff45db28150d7c140be493fe851e6560f27
> run-tests: write out scripts in binary mode

Queued for default, thanks.

Patch

diff --git a/tests/run-tests.py b/tests/run-tests.py
--- a/tests/run-tests.py
+++ b/tests/run-tests.py
@@ -753,7 +753,7 @@ 
 
     # Write out the script and execute it
     name = wd + '.sh'
-    f = open(name, 'w')
+    f = open(name, 'wb')
     for l in script:
         f.write(l)
     f.close()