diff --git a/gobject/tests/taptestrunner.py b/gobject/tests/taptestrunner.py index bdadd9f00..261496197 100644 --- a/gobject/tests/taptestrunner.py +++ b/gobject/tests/taptestrunner.py @@ -121,6 +121,9 @@ class TAPTestResult(unittest.TestResult): self.print_raw(" ...\n") else: self.print_raw("# " + output.rstrip().replace("\n", "\n# ") + "\n") + # Truncate doesn't change the current stream position. + # Seek to the beginning to avoid extensions on subsequent writes. + log.seek(0) log.truncate(0) def addSuccess(self, test):