Skip to content

Commit f06226e

Browse files
drknowhowclaude
andcommitted
fix: force UTF-8 console so Oracle server starts on Windows cp1252
run_oracle printed a '→' in its startup banner, which crashed with UnicodeEncodeError on Windows consoles/pipes using the cp1252 code page (observed on Python 3.14), so the server never finished booting. Added _force_utf8_console(), called first in run_oracle, to reconfigure stdout/stderr to UTF-8 (errors="replace") — covering both startup banners and the logging StreamHandler. Verified the server now boots without the PYTHONIOENCODING=utf-8 workaround. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
1 parent e6e8c61 commit f06226e

1 file changed

Lines changed: 11 additions & 0 deletions

File tree

oracle/oracle_server.py

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -825,8 +825,19 @@ def _is_oracle_running(port: int) -> bool:
825825
return False
826826

827827

828+
def _force_utf8_console() -> None:
829+
"""Make stdout/stderr UTF-8 so banner/log output can't crash on legacy
830+
Windows code pages (cp1252 raises UnicodeEncodeError on chars like '→')."""
831+
for stream in (sys.stdout, sys.stderr):
832+
try:
833+
stream.reconfigure(encoding="utf-8", errors="replace")
834+
except (AttributeError, ValueError, OSError):
835+
pass
836+
837+
828838
def run_oracle(port: int = None, open_browser: bool = None):
829839
"""Main entry point for Oracle server."""
840+
_force_utf8_console()
830841
_init_services()
831842

832843
cfg = load_config()

0 commit comments

Comments
 (0)