smoke, test_docs_cli_flags: guard stdout encoding and map dev.py smoke subcommand

Address review feedback from @Poussistar on #705:
1. Reconfigure sys.stdout with errors='replace' in scripts/smoke.py's
   __main__ block to satisfy repository-wide test_tool_stdout_encoding.py.
2. Register 'smoke': 'scripts/smoke.py' in tests/test_docs_cli_flags.py
   DEV_PRODUCERS map so fenced docs commands invoking 'dev.py smoke --quick'
   do not report --quick as an unknown flag of dev.py.

AI-assisted (Claude Code)
This commit is contained in:
d7ommy
2026-11-25 19:29:20 +03:00
parent c87512e482
commit a9692a8c98
2 changed files with 5 additions and 0 deletions

View File

@ -325,4 +325,8 @@ def main(argv: list[str] | None = None) -> int:
if __name__ == "__main__":
try:
sys.stdout.reconfigure(errors="replace")
except (AttributeError, ValueError, OSError):
pass
raise SystemExit(main())

View File

@ -164,6 +164,7 @@ def fenced_commands(text):
DEV_PRODUCERS = {
"boot-trace": "tools/boot_trace.py",
"guest-scene": "scripts/run_guest_scene.py",
"smoke": "scripts/smoke.py",
}