mirror of
https://github.com/OrcaSlicer/OrcaSlicer.git
synced 2026-11-27 07:39:40 -05:00
* Keep non-Latin path names intact in the plugin audit keyword check
is_denied_path_keyword() lowercased every path component with
std::tolower(), which follows the C locale. With a single-byte locale,
which the UI language sets on Windows (Russian_Russia.1251), that
rewrites bytes of UTF-8 sequences: "Новая папка" is no longer valid
UTF-8, and has_denied_config_extension() then throws "boost::filesystem
::path codecvt to wstring: partial" while turning it back into a path.
The exception left the CPython audit hook, so the plugin call never
returned, and the app crashed later in PyFrame_GetCode.
The keyword check now uses the file's ascii_lower(), which lowercases
A-Z only; the keywords are ASCII, so matching stays case-insensitive.
ascii_lower() itself no longer goes through a locale-aware
boost::algorithm::to_lower(), so the network permission keys get the
same guarantee. The audit hook also no longer lets any C++ exception
reach the interpreter: a check that fails denies the event, like an
unanswered prompt.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
* Address review: narrower try in audit_hook, shorter comments, a test for the catch
- Wrap only audit_plugin_event() in the try, so release_frames() is called
once after the event is decided.
- Shorten the ascii_lower() comment and drop the one that repeated it.
- Use only the .1251 locale in the non-Latin path test.
- Test that a permission prompt that throws denies the event, which
reaches the new catch on every platform.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
---------
Co-authored-by: GNUGiminot <215263196+GNUGiminot@users.noreply.github.com>
Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
Co-authored-by: SoftFever <103989404+SoftFever@users.noreply.github.com>
(cherry picked from commit 2ec1a0732f)