From 6a11d6bd6a2a0dcf3f1e8f534e8bba59aef48de2 Mon Sep 17 00:00:00 2001 From: Nicholas Smith Date: Thu, 19 Dec 2024 17:42:50 -0600 Subject: [PATCH] Don't override AbstractBufferedFile.flush implementation --- src/fsspec_xrootd/xrootd.py | 20 -------------------- 1 file changed, 20 deletions(-) diff --git a/src/fsspec_xrootd/xrootd.py b/src/fsspec_xrootd/xrootd.py index c578e68..b9c5841 100644 --- a/src/fsspec_xrootd/xrootd.py +++ b/src/fsspec_xrootd/xrootd.py @@ -911,26 +911,6 @@ def _fetch_range(self, start: int, end: int) -> Any: raise OSError(f"File did not read properly: {status.message}") return data - def flush(self, force: bool = False) -> None: - if self.closed: - raise ValueError("Flush on closed file") - if force and self.forced: - raise ValueError("Force flush cannot be called more than once") - if force: - self.forced = True - - if self.mode not in {"wb", "ab"}: - # no-op to flush on read-mode - return - - if not force and self.buffer.tell() < self.blocksize: - # Defer write on small block - return - - if self._upload_chunk(final=force) is not False: - self.offset += self.buffer.seek(0, 2) - self.buffer = io.BytesIO() - def _upload_chunk(self, final: bool = False) -> Any: status, _n = self._myFile.write( self.buffer.getvalue(),