Clean up POSIX path conversion.

Replace `str.join` with `Path.as_posix`.
This commit is contained in:
Nathan Baker
2023-12-30 15:25:46 -08:00
parent a757325efb
commit 8659f0372e

View File

@@ -41,7 +41,7 @@ def open_file_for_reading(input_file: _TextIOSource) -> ContextManager[IO[str]]:
print(f"Parent {p} is not ZIP file.") print(f"Parent {p} is not ZIP file.")
continue continue
zf = zipfile.ZipFile(p) zf = zipfile.ZipFile(p)
path_string = "/".join(input_file.relative_to(p).parts) path_string = Path.as_posix(input_file.relative_to(p))
stream = zf.open(path_string) stream = zf.open(path_string)
return io.TextIOWrapper(stream) return io.TextIOWrapper(stream)