Commits

Siddharth Agarwal committed 2631b35

run-tests: open child-parent pipes in binary mode

Python's pickle is a binary format.

Comments (0)

Files changed (1)

tests/run-tests.py

         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
         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)