From 9858a978936097b8922d1c9031a914ef97d08917 Mon Sep 17 00:00:00 2001 From: Dimitri Papadopoulos <3234522+DimitriPapadopoulos@users.noreply.github.com> Date: Wed, 4 Oct 2023 19:39:12 +0200 Subject: [PATCH] =?UTF-8?q?IOError=20=E2=86=92=20OSError?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Starting from Python 3.3, IOError is an alias of OSError: https://docs.python.org/3/library/exceptions.html#IOError --- fsspec/implementations/zip.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/fsspec/implementations/zip.py b/fsspec/implementations/zip.py index 91c8ec4f4..f828a6841 100644 --- a/fsspec/implementations/zip.py +++ b/fsspec/implementations/zip.py @@ -113,10 +113,10 @@ def _open( path = self._strip_protocol(path) if "r" in mode and self.mode in set("wa"): if self.exists(path): - raise IOError("ZipFS can only be open for reading or writing, not both") + raise OSError("ZipFS can only be open for reading or writing, not both") raise FileNotFoundError(path) if "r" in self.mode and "w" in mode: - raise IOError("ZipFS can only be open for reading or writing, not both") + raise OSError("ZipFS can only be open for reading or writing, not both") out = self.zip.open(path, mode.strip("b")) if "r" in mode: info = self.info(path)