The cheat, ExeFS patch and plugin tools read and write their patch files as UTF-8, the encoding recomp/patches.py load now reads them in

Without Python's UTF-8 mode these tools used the locale code page, so a plugin image path with non-ASCII characters
(tools/exefs_plugins.py plugin_lines) would reach the generator in a code page it no longer reads.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
Valiantsin DzerakhandClaude Opus 5.5 committed 2026-11-19 21:07:01 +03:00
1 parent f780b3d216
commit a7f24442b6
3 files changed
+7 -7

No files matched your search

+2 -2
View File
@@ -454,7 +454,7 @@ def plugin_files(mods):
def emit(results, args):
"""--patches-out and --status from the checked plugins. results: one (module, its NSO file, its record or None,
the record's directory, hooks, reasons) per plugin of the layout; no reasons: accepted."""
text = args.patches.read_text() if args.patches else ''
text = args.patches.read_text(encoding='utf-8') if args.patches else ''
builtin = builtin_sites(text)
status, sets = [], []
files = {str(f.resolve()): (m, rel, f) for m, rel, f in plugin_files(args.mods)}
@@ -482,7 +482,7 @@ def emit(results, args):
if over else ''))
if sets:
text += '\n# Mod plugins (tools/exefs_plugins.py)\n' + '\n'.join(line for s in sets for line in s) + '\n'
args.patches_out.write_text(text)
args.patches_out.write_text(text, encoding='utf-8')
args.status.parent.mkdir(parents=True, exist_ok=True)
args.status.write_text('\n'.join(status) + ('\n' if status else ''), encoding='utf-8')