From e117a1f563356a6c66369e3abf2fb970f2ccb5ff Mon Sep 17 00:00:00 2001 From: Robert Collins Date: Sat, 16 Mar 2013 03:30:24 +1300 Subject: More reasoning for \n in return-code injection. --- testrepository/commands/run.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/testrepository/commands/run.py b/testrepository/commands/run.py index 16d861d..524716a 100644 --- a/testrepository/commands/run.py +++ b/testrepository/commands/run.py @@ -68,7 +68,10 @@ class ReturnCodeToSubunit(object): returncode = self.proc.wait() if returncode != 0: if self.lastoutput != LINEFEED: - # Subunit is line orientated, it has to start on a fresh line. + # Subunit V1 is line orientated, it has to start on a fresh + # line. V2 needs to start on any fresh utf8 character border + # - which is not guaranteed in an arbitrary stream endpoint, so + # injecting a \n gives us such a guarantee. self.source.write(_b('\n')) if v2_avail: stream = subunit.StreamResultToBytes(self.source) -- cgit v1.2.1