From 528119bde4d31598ac510bf9cc43aeedd7985f1c Mon Sep 17 00:00:00 2001 From: Charles Haley Date: Thu, 6 Feb 2025 10:38:25 +0000 Subject: [PATCH] Flush stdout just before finishing shutdown so the last messages are written to the log file. --- src/calibre/gui2/ui.py | 1 + 1 file changed, 1 insertion(+) diff --git a/src/calibre/gui2/ui.py b/src/calibre/gui2/ui.py index eb5946c857..a25f900959 100644 --- a/src/calibre/gui2/ui.py +++ b/src/calibre/gui2/ui.py @@ -1323,6 +1323,7 @@ class Main(MainWindow, MainWindowMixin, DeviceMixin, EmailMixin, # {{{ self.istores.join() wait_for_cleanup() wait_for_stop() + sys.stdout.flush() # Make sure any buffered prints are written for debug mode self.shutdown_completed.emit() return True