From 1f6151250e8586ba8af3b7cd910dc4f0e1715596 Mon Sep 17 00:00:00 2001 From: Elliott Sales de Andrade Date: Mon, 23 Sep 2024 09:51:45 -0400 Subject: [PATCH] Fix handling of Paths in zip implementation (#1689) Fixes #1688 Co-authored-by: Martin Durant --- fsspec/implementations/zip.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/fsspec/implementations/zip.py b/fsspec/implementations/zip.py index aa6a57842..6db3ae278 100644 --- a/fsspec/implementations/zip.py +++ b/fsspec/implementations/zip.py @@ -1,3 +1,4 @@ +import os import zipfile import fsspec @@ -48,7 +49,7 @@ def __init__( if mode not in set("rwa"): raise ValueError(f"mode '{mode}' no understood") self.mode = mode - if isinstance(fo, str): + if isinstance(fo, (str, os.PathLike)): if mode == "a": m = "r+b" else: