Graph-Native Infrastructure for Context and Accountable AI Systems
Python agent-memoryaiai-governanceai-infrastructureartificial-intelligencecontext-engineeringcontext-graphsdata-engineeringdecision-intelligencedeveloper-toolsexplainable-aigenerative-aigraph-ragknowledge-graphllmontologyprovenancepythonreasoningsemantic-search
fix(cli): reconfigure stdout/stderr to UTF-8 on Windows at import time
KaifAhmad14f1740e19c5a
diff --git a/semantica/cli.py b/semantica/cli.pyindex dde3959e..941d76d4 100644--- a/semantica/cli.py+++ b/semantica/cli.py@@ -8,6 +8,16 @@ enabling users to interact with the framework via terminal commands.import jsonimport osimport sys++# Reconfigure stdout/stderr to UTF-8 on Windows before any other import+# captures sys.stdout (Rich, Click). This prevents UnicodeEncodeError from+# box-drawing characters and emoji on the default cp1252 code page.+if sys.platform == "win32":+ if sys.stdout is not None and hasattr(sys.stdout, "reconfigure"):+ sys.stdout.reconfigure(encoding="utf-8", errors="replace")+ if sys.stderr is not None and hasattr(sys.stderr, "reconfigure"):+ sys.stderr.reconfigure(encoding="utf-8", errors="replace")+from dataclasses import asdict, dataclass, is_dataclassfrom pathlib import Pathfrom typing import TYPE_CHECKING, Any, Callable, Dict, List, Optional, Sequence, Tuple