Run subprocess with safe UTF-8 handling and error replacement.
(
cmd: list[str], **kwargs: Any
)
| 105 | |
| 106 | |
| 107 | def run_subprocess_safe( |
| 108 | cmd: list[str], **kwargs: Any |
| 109 | ) -> subprocess.CompletedProcess[str]: |
| 110 | """Run subprocess with safe UTF-8 handling and error replacement.""" |
| 111 | kwargs.setdefault("encoding", "utf-8") |
| 112 | kwargs.setdefault("errors", "replace") |
| 113 | kwargs.setdefault("env", get_docker_env()) |
| 114 | return subprocess.run(cmd, **kwargs) # type: ignore[return-value] |
| 115 | |
| 116 | |
| 117 | def run_docker_command_streaming(cmd: list[str]) -> int: |
nothing calls this directly
no test coverage detected