mirror of
https://github.com/OrcaSlicer/OrcaSlicer.git
synced 2026-07-31 06:42:07 +00:00
fix: lift audit while reporting errors to log files
This commit is contained in:
@@ -87,6 +87,12 @@ void log_python_exception_keep(pybind11::error_already_set& err)
|
|||||||
if (!gil)
|
if (!gil)
|
||||||
return;
|
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)
|
// 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++
|
// 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
|
// catchers can still read err.what() for the user-facing dialog. We must NOT use
|
||||||
|
|||||||
Reference in New Issue
Block a user