Index: tko/parsers/version_0.py |
diff --git a/tko/parsers/version_0.py b/tko/parsers/version_0.py |
index 7e8a5d884c598c69a2eb41a2a48e9d062ca4c20f..b061f2a75cb9b410840a2fd38d5d45c360ad0f0a 100644 |
--- a/tko/parsers/version_0.py |
+++ b/tko/parsers/version_0.py |
@@ -251,17 +251,26 @@ class status_line(object): |
def parse_line(cls, line): |
if not status_line.is_status_line(line): |
return None |
- indent, line = re.search(r"^(\t*)(.*)$", line).groups() |
+ # We sometimes get multi-line input, bug? |
+ lines = line.splitlines() |
+ if len(lines) > 1: |
+ tko_utils.dprint('Got multi-line input to parse_line().') |
+ tko_utils.dprint('Input lines: %s' % repr(lines)) |
+ indent, line = re.search(r"^(\t*)(.*)$", line, re.DOTALL).groups() |
indent = len(indent) |
# split the line into the fixed and optional fields |
- parts = line.split("\t") |
+ parts = line.rstrip().split("\t") |
status, subdir, testname = parts[0:3] |
reason = parts[-1] |
optional_parts = parts[3:-1] |
# all the optional parts should be of the form "key=value" |
- assert sum('=' not in part for part in optional_parts) == 0 |
+ if sum('=' not in part for part in optional_parts) != 0: |
+ # this may not have been a status line |
+ tko_utils.dprint('This does not look like a status line, skipping.') |
+ tko_utils.dprint('Line: %s' % line) |
+ return None |
optional_fields = dict(part.split("=", 1) |
for part in optional_parts) |