The isatty() check skipped UTF-8 wrapping when agent-reach was called as a subprocess by AI agents (non-TTY). On Windows with GBK encoding, any remaining non-ASCII chars would crash with UnicodeEncodeError. Now UTF-8 wrapping applies in all environments on Windows. Closes #95 Co-authored-by: Panniantong <panniantong@users.noreply.github.com>
This commit is contained in:
parent
8a90e52fde
commit
75a2213510
1 changed files with 0 additions and 2 deletions
|
|
@ -25,8 +25,6 @@ def _ensure_utf8_console():
|
|||
# Avoid interfering with pytest/captured streams.
|
||||
if os.environ.get("PYTEST_CURRENT_TEST"):
|
||||
return
|
||||
if not getattr(sys.stdout, "isatty", lambda: False)():
|
||||
return
|
||||
try:
|
||||
import io
|
||||
if hasattr(sys.stdout, "buffer"):
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue