(path: Path, binary: bool = False)
| 67 | |
| 68 | |
| 69 | def read_text(path: Path, binary: bool = False) -> str | None: |
| 70 | try: |
| 71 | if binary: |
| 72 | return path.read_bytes().replace(b"\x00", b" ").decode("utf-8", "ignore").strip() |
| 73 | return path.read_text().strip() |
| 74 | except Exception: |
| 75 | return None |
| 76 | |
| 77 | |
| 78 | def read_argv(path: Path) -> list[str] | None: |
no test coverage detected