(name: str)
| 249 | |
| 250 | |
| 251 | def safe_member_name(name: str) -> bool: |
| 252 | if not name or "\\" in name or "\x00" in name or name.startswith("/"): |
| 253 | return False |
| 254 | pure = pathlib.PurePosixPath(name) |
| 255 | return ( |
| 256 | not pure.is_absolute() |
| 257 | and pure.as_posix() == name |
| 258 | and all(part not in ("", ".", "..") for part in pure.parts) |
| 259 | ) |
| 260 | |
| 261 | |
| 262 | def hash_stream(stream: BinaryIO, *, declared_size: int, label: str) -> tuple[str, int]: |
no outgoing calls
no test coverage detected