Rev 5172: (vila) Additional fix for selftest --parallel & --subunit on win32. (Gordon Tyler) in file:///home/pqm/archives/thelove/bzr/%2Btrunk/
Canonical.com Patch Queue Manager
pqm at pqm.ubuntu.com
Thu Apr 22 15:22:47 BST 2010
At file:///home/pqm/archives/thelove/bzr/%2Btrunk/
------------------------------------------------------------
revno: 5172 [merge]
revision-id: pqm at pqm.ubuntu.com-20100422142242-02lpi0ygs2oqoump
parent: pqm at pqm.ubuntu.com-20100422004534-nuqgl0mux4xw19kj
parent: gordon at doxxx.net-20100421121743-acji7856tda0gjwq
committer: Canonical.com Patch Queue Manager <pqm at pqm.ubuntu.com>
branch nick: +trunk
timestamp: Thu 2010-04-22 15:22:42 +0100
message:
(vila) Additional fix for selftest --parallel & --subunit on win32. (Gordon Tyler)
modified:
bzrlib/builtins.py builtins.py-20050830033751-fc01482b9ca23183
bzrlib/tests/__init__.py selftest.py-20050531073622-8d0e3c8845c97a64
=== modified file 'bzrlib/builtins.py'
--- a/bzrlib/builtins.py 2010-04-19 13:04:30 +0000
+++ b/bzrlib/builtins.py 2010-04-22 14:22:42 +0000
@@ -3592,6 +3592,11 @@
raise errors.BzrCommandError("subunit not available. subunit "
"needs to be installed to use --subunit.")
self.additional_selftest_args['runner_class'] = SubUnitBzrRunner
+ # On Windows, disable automatic conversion of '\n' to '\r\n' in
+ # stdout, which would corrupt the subunit stream.
+ if sys.platform == "win32" and sys.stdout.fileno() >= 0:
+ import msvcrt
+ msvcrt.setmode(sys.stdout.fileno(), os.O_BINARY)
if parallel:
self.additional_selftest_args.setdefault(
'suite_decorators', []).append(parallel)
=== modified file 'bzrlib/tests/__init__.py'
--- a/bzrlib/tests/__init__.py 2010-04-21 05:05:02 +0000
+++ b/bzrlib/tests/__init__.py 2010-04-22 14:22:42 +0000
@@ -3276,9 +3276,7 @@
bzr_path = [bzr_path]
if sys.platform == "win32":
# if we're on windows, we can't execute the bzr script directly
- # and we have to enable unbuffered binary stdout/stderr so that
- # automatic CRLF conversion doesn't corrupt the subunit streams
- bzr_path = [sys.executable, '-u'] + bzr_path
+ bzr_path = [sys.executable] + bzr_path
fd, test_list_file_name = tempfile.mkstemp()
test_list_file = os.fdopen(fd, 'wb', 1)
for test in process_tests:
More information about the bazaar-commits
mailing list