1
0
mirror of https://github.com/EDCD/EDMarketConnector.git synced 2025-04-18 18:07:37 +03:00

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.
This commit is contained in:
Athanasius 2021-01-22 13:10:03 +00:00
parent 831367c30b
commit 11b1c436a7

View File

@ -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()