diff --git a/fsspec/spec.py b/fsspec/spec.py index 14e6dbbd4..67bd167f0 100644 --- a/fsspec/spec.py +++ b/fsspec/spec.py @@ -809,7 +809,7 @@ def put_file(self, lpath, rpath, callback=_DEFAULT_CALLBACK, **kwargs): self.mkdirs(self._parent(os.fspath(rpath)), exist_ok=True) with self.open(rpath, "wb", **kwargs) as f2: - while f2.tell() < size: + while f1.tell() < size: data = f1.read(self.blocksize) segment_len = f2.write(data) callback.relative_update(segment_len)