From 04f7f6ca7297fcbfddfd33a7bf727d47ffd7d1fa Mon Sep 17 00:00:00 2001 From: Kovid Goyal Date: Tue, 15 Apr 2025 07:06:57 +0530 Subject: [PATCH] Fix a regression in 8.1 that broke displaying of the debug log when running in debug mode --- src/calibre/gui2/main.py | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/src/calibre/gui2/main.py b/src/calibre/gui2/main.py index 1cf737aec0..2b3e871d41 100644 --- a/src/calibre/gui2/main.py +++ b/src/calibre/gui2/main.py @@ -375,11 +375,10 @@ class GuiRunner(QObject): def run_in_debug_mode(): import subprocess - import tempfile + from calibre.constants import cache_dir from calibre.debug import run_calibre_debug - fd, logpath = tempfile.mkstemp('.txt') - os.close(fd) + logpath = os.path.join(cache_dir(), 'calibre-debug-log.txt') run_calibre_debug( '--gui-debug', logpath, stdout=open(logpath, 'wb'), stderr=subprocess.STDOUT, stdin=open(os.devnull, 'rb'))