From c69a98057f47e8b50d8599996aa2fe91b6a8c56e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tomasz=20Mi=C4=85sko?= Date: Wed, 12 Dec 2018 00:00:00 +0000 Subject: [PATCH] tests: Avoid writing ever increasing sequence of null bytes to test logs --- gobject/tests/taptestrunner.py | 3 +++ 1 file changed, 3 insertions(+) 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):