From 11b1c436a753bffe55cf767143c78d8081ee8619 Mon Sep 17 00:00:00 2001 From: Athanasius Date: Fri, 22 Jan 2021 13:10:03 +0000 Subject: [PATCH] seek(0) before sys.stdout.truncate() Without this we only truncate to where the file was when we did the stdout/err redirect. What I observed was it truncated out the "journal locking" output, but not anything from a prior run of the program. --- EDMarketConnector.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/EDMarketConnector.py b/EDMarketConnector.py index dd94cbbf..eb9b81eb 100755 --- a/EDMarketConnector.py +++ b/EDMarketConnector.py @@ -242,6 +242,8 @@ if __name__ == '__main__': # noqa: C901 if getattr(sys, 'frozen', False): # Now that we're sure we're the only instance running we can truncate the logfile + logger.trace('Truncating plain logfile') + sys.stdout.seek(0) sys.stdout.truncate()