Files
BMAD-METHOD/src
aranella 9b80b04666 fix(brainstorming): pin brain.py console streams to UTF-8 (#2578)
brain.py prints two kinds of arbitrary user text: --extra overlay
techniques (customize.toml additional_techniques) and, on stderr, the
technique name echoed back by `show NAME` when it is not found. Either
can carry a character the platform default cannot encode, and print()
then raises UnicodeEncodeError. The shipped catalog is cp1252-safe (its
only non-ASCII is U+2014), so this is an overlay/argv path, not a
default-catalog crash.

pin_utf8() passes errors= through rather than letting it default:
reconfigure(encoding=...) alone resets the handler to strict, which
would silently downgrade stderr's POSIX default of backslashreplace
and turn a diagnostic about an undecodable path into a traceback.
Thanks to @armelhbobdad for catching that on #2693.

Four regression tests, all four red against the unpatched script.

Co-authored-by: Claude Opus 5 (1M context) <noreply@anthropic.com>
2026-08-23 18:05:46 -05:00
..