native_ask ran kdialog/zenity with subprocess.run(text=True), so a
folder whose name the locale encoding cannot decode made the call raise
UnicodeDecodeError, which pick_game does not catch (it only catches
OSError). The dialog's answer is now read as bytes and decoded with
os.fsdecode, whose surrogateescape str round-trips through os.fsencode
to the same bytes the tool printed; the return codes keep their meaning.
print()ing that str on a UTF-8 terminal raises UnicodeEncodeError, so the
log lines about the chosen folder go through the new show_path(), which
shows the undecodable bytes escaped; the path handed to the build is
untouched. tests/test_make_game_pick_fsdecode.py covers both with a
stand-in dialog printing raw bytes (python -I, standard library only).
AI-assisted.
Co-Authored-By: Mistral Vibe <vibe@mistral.ai>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>