Commit Graph

1 Commits

Author SHA1 Message Date
82d0dfcc40 make_game: a folder chosen in kdialog/zenity whose name is not valid in the locale encoding no longer stops --pick (MAKE-GAME-PICK-FSDECODE)
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>
2026-11-26 16:58:20 +01:00