Skip to content

armgit / strix

Public Imported from GitHub
0

Open-source AI penetration testing tool to find and fix your app’s vulnerabilities.

style: drop docstrings from the UTF-8 stream helpers

Ahmed Allam7280c40caa3e
diff --git a/strix/interface/main.py b/strix/interface/main.py
index a7ab2dc5..8b263fae 100644
--- a/strix/interface/main.py
+++ b/strix/interface/main.py
@@ -416,14 +416,6 @@ def _bootstrap_scan(args: argparse.Namespace) -> None:
def _force_utf8_streams() -> None:
- """Give stdout/stderr a UTF-8 encoding, whatever the console code page.
-
- Windows hands a redirected or legacy console stream the ANSI code page
- (cp1252 and friends), which cannot encode Rich's output or the model's
- text: one ``\u2713`` in a finding ends a headless run with
- ``UnicodeEncodeError``. Streams without ``reconfigure`` (test captures,
- replaced file objects) are left alone.
- """
for stream in (sys.stdout, sys.stderr):
reconfigure = getattr(stream, "reconfigure", None)
if reconfigure is None:
diff --git a/strix/interface/tui/runtime.py b/strix/interface/tui/runtime.py
index de3a4b73..7473bc0c 100644
--- a/strix/interface/tui/runtime.py
+++ b/strix/interface/tui/runtime.py
@@ -59,12 +59,6 @@ class GoTuiPreActivationError(RuntimeError):
def _open_output_sink() -> TextIO:
- """A UTF-8 ``os.devnull`` handle for Python's stdout/stderr while the Go TUI owns the terminal.
-
- UTF-8 is explicit because the locale encoding (cp1252 on Windows) cannot take
- the model's text, and a logging handler that fails to write there floods the
- log with ``--- Logging error ---`` reports.
- """
return Path(os.devnull).open("a", buffering=1, encoding="utf-8")
diff --git a/tests/test_utf8_streams.py b/tests/test_utf8_streams.py
index ebe42b6d..d2174859 100644
--- a/tests/test_utf8_streams.py
+++ b/tests/test_utf8_streams.py
@@ -1,5 +1,3 @@
-"""Windows gives redirected stdout/stderr the ANSI code page; Strix forces UTF-8 (STR-742)."""
-
from __future__ import annotations
import io