From 35970f61dcd3c4b8e03092df7b2fe88f77cecf49 Mon Sep 17 00:00:00 2001 From: Ian Chua Date: Wed, 29 Jul 2026 16:52:16 +0800 Subject: [PATCH] fix: lift audit while reporting errors to log files --- src/slic3r/plugin/PythonInterpreter.cpp | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/slic3r/plugin/PythonInterpreter.cpp b/src/slic3r/plugin/PythonInterpreter.cpp index e46ee58f80..299a2dd7ba 100644 --- a/src/slic3r/plugin/PythonInterpreter.cpp +++ b/src/slic3r/plugin/PythonInterpreter.cpp @@ -87,6 +87,12 @@ void log_python_exception_keep(pybind11::error_already_set& err) if (!gil) return; + // Traceback output is host-owned work. In particular, the stderr tee opens the Python log + // file on every write. Keep that open outside the plugin audit context, otherwise an ordinary + // exception raised by a plugin can recursively trigger the filesystem permission dialog while + // its original exception is being reported. + ScopedPluginAuditContext audit_suppression(""); + // Non-destructive: print the traceback to sys.stderr (tee'd to the session log) // WITHOUT consuming err, so the caller can rethrow it intact. For example, downstream C++ // catchers can still read err.what() for the user-facing dialog. We must NOT use