changeset 17925:2631b3576a33

run-tests: open child-parent pipes in binary mode Python's pickle is a binary format.
author Siddharth Agarwal <sid0@fb.com>
date Sat, 10 Nov 2012 11:37:41 -0800
parents 1e6b5faf9d4e
children 65a46635fb31
files tests/run-tests.py
diffstat 1 files changed, 2 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/tests/run-tests.py	Mon Nov 12 19:27:03 2012 +0200
+++ b/tests/run-tests.py	Sat Nov 10 11:37:41 2012 -0800
@@ -1071,7 +1071,7 @@
         childopts += ['--tmpdir', childtmp]
         cmdline = [PYTHON, sys.argv[0]] + opts + childopts + job
         vlog(' '.join(cmdline))
-        fps[os.spawnvp(os.P_NOWAIT, cmdline[0], cmdline)] = os.fdopen(rfd, 'r')
+        fps[os.spawnvp(os.P_NOWAIT, cmdline[0], cmdline)] = os.fdopen(rfd, 'rb')
         os.close(wfd)
     signal.signal(signal.SIGINT, signal.SIG_IGN)
     failures = 0
@@ -1155,7 +1155,7 @@
         ignored = len(results['i'])
 
         if options.child:
-            fp = os.fdopen(options.child, 'w')
+            fp = os.fdopen(options.child, 'wb')
             pickle.dump(results, fp, pickle.HIGHEST_PROTOCOL)
             if options.time:
                 pickle.dump(times, fp, pickle.HIGHEST_PROTOCOL)