Script 'mail_helper' called by obssrc Hello community, here is the log from the commit of package python-gcsfs for openSUSE:Factory checked in at 2023-06-07 23:06:34 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Comparing /work/SRC/openSUSE:Factory/python-gcsfs (Old) and /work/SRC/openSUSE:Factory/.python-gcsfs.new.15902 (New) ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "python-gcsfs" Wed Jun 7 23:06:34 2023 rev:16 rq:1091179 version:2023.5.0 Changes: -------- --- /work/SRC/openSUSE:Factory/python-gcsfs/python-gcsfs.changes 2023-03-27 18:15:38.366903719 +0200 +++ /work/SRC/openSUSE:Factory/.python-gcsfs.new.15902/python-gcsfs.changes 2023-06-07 23:07:03.855218712 +0200 @@ -1,0 +2,7 @@ +Wed Jun 7 04:27:24 UTC 2023 - Steve Kowalik <[email protected]> + +- Update to 2023.5.0: + * Allow emulator host without protocol (#548) + * Prevent upload retry from closing the file being sent (#540) + +------------------------------------------------------------------- Old: ---- gcsfs-2023.3.0-gh.tar.gz New: ---- gcsfs-2023.5.0-gh.tar.gz ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ python-gcsfs.spec ++++++ --- /var/tmp/diff_new_pack.a7AcXw/_old 2023-06-07 23:07:04.475222312 +0200 +++ /var/tmp/diff_new_pack.a7AcXw/_new 2023-06-07 23:07:04.479222336 +0200 @@ -17,11 +17,10 @@ Name: python-gcsfs -Version: 2023.3.0 +Version: 2023.5.0 Release: 0 Summary: Filesystem interface over GCS License: BSD-3-Clause -Group: Development/Languages/Python URL: https://github.com/fsspec/gcsfs # Use the GitHub tarball for test data Source: https://github.com/fsspec/gcsfs/archive/refs/tags/%{version}.tar.gz#/gcsfs-%{version}-gh.tar.gz ++++++ gcsfs-2023.3.0-gh.tar.gz -> gcsfs-2023.5.0-gh.tar.gz ++++++ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/gcsfs-2023.3.0/docs/source/changelog.rst new/gcsfs-2023.5.0/docs/source/changelog.rst --- old/gcsfs-2023.3.0/docs/source/changelog.rst 2023-03-04 21:33:12.000000000 +0100 +++ new/gcsfs-2023.5.0/docs/source/changelog.rst 2023-05-07 21:21:05.000000000 +0200 @@ -1,6 +1,17 @@ Changelog ========= +2023.5.0 +-------- + +* Allow emulator host without protocol (#548) +* Prevent upload retry from closing the file being sent (#540) + +2023.4.0 +-------- + +No changes + 2023.3.0 -------- diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/gcsfs-2023.3.0/gcsfs/_version.py new/gcsfs-2023.5.0/gcsfs/_version.py --- old/gcsfs-2023.3.0/gcsfs/_version.py 2023-03-04 21:33:12.000000000 +0100 +++ new/gcsfs-2023.5.0/gcsfs/_version.py 2023-05-07 21:21:05.000000000 +0200 @@ -22,9 +22,9 @@ # setup.py/versioneer.py will grep for the variable names, so they must # each be defined on a line of their own. _version.py will just call # get_keywords(). - git_refnames = "2023.3.0" - git_full = "dda390af941b57b6911261e5c76d01cc3ddccb10" - git_date = "2023-03-04 15:33:12 -0500" + git_refnames = "2023.5.0" + git_full = "2354d6b0ae598a9107ca2f63af12ebc98d41de5f" + git_date = "2023-05-07 15:21:05 -0400" keywords = {"refnames": git_refnames, "full": git_full, "date": git_date} return keywords diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/gcsfs-2023.3.0/gcsfs/core.py new/gcsfs-2023.5.0/gcsfs/core.py --- old/gcsfs-2023.3.0/gcsfs/core.py 2023-03-04 21:33:12.000000000 +0100 +++ new/gcsfs-2023.5.0/gcsfs/core.py 2023-05-07 21:21:05.000000000 +0200 @@ -96,6 +96,14 @@ return (await r.read()).decode() +class UnclosableBytesIO(io.BytesIO): + """Prevent closing BytesIO to avoid errors during retries.""" + + def close(self): + """Reset stream position for next retry.""" + self.seek(0) + + def _location(): """ Resolves GCS HTTP location as http[s]://host @@ -107,9 +115,13 @@ valid http location """ _emulator_location = os.getenv("STORAGE_EMULATOR_HOST", None) - return ( - _emulator_location if _emulator_location else "https://storage.googleapis.com" - ) + if _emulator_location: + if not any( + _emulator_location.startswith(scheme) for scheme in ("http://", "https://") + ): + _emulator_location = f"http://{_emulator_location}" + return _emulator_location + return "https://storage.googleapis.com" def _chunks(lst, n): @@ -402,7 +414,6 @@ data=data, timeout=self.requests_timeout, ) as r: - status = r.status headers = r.headers info = r.request_info # for debug only @@ -1564,7 +1575,7 @@ shortfall = (self.offset + l - 1) - end if shortfall > 0: self.checker.update(data[:-shortfall]) - self.buffer = io.BytesIO(data[-shortfall:]) + self.buffer = UnclosableBytesIO(data[-shortfall:]) self.buffer.seek(shortfall) self.offset += l - shortfall continue @@ -1577,7 +1588,7 @@ self.checker.update(data) self.checker.validate_json_response(j) # Clear buffer and update offset when all is received - self.buffer = io.BytesIO() + self.buffer = UnclosableBytesIO() self.offset += l break return True @@ -1682,7 +1693,9 @@ range = "bytes %i-%i/%i" % (offset, offset + l - 1, size) head["Content-Range"] = range head.update({"Content-Type": content_type, "Content-Length": str(l)}) - headers, txt = await fs._call("POST", location, headers=head, data=io.BytesIO(data)) + headers, txt = await fs._call( + "POST", location, headers=head, data=UnclosableBytesIO(data) + ) if "Range" in headers: end = int(headers["Range"].split("-")[1]) shortfall = (offset + l - 1) - end @@ -1748,7 +1761,7 @@ path, uploadType="multipart", headers={"Content-Type": 'multipart/related; boundary="==0=="'}, - data=io.BytesIO(data), + data=UnclosableBytesIO(data), json_out=True, ) checker.update(datain) diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/gcsfs-2023.3.0/requirements.txt new/gcsfs-2023.5.0/requirements.txt --- old/gcsfs-2023.3.0/requirements.txt 2023-03-04 21:33:12.000000000 +0100 +++ new/gcsfs-2023.5.0/requirements.txt 2023-05-07 21:21:05.000000000 +0200 @@ -1,6 +1,6 @@ aiohttp!=4.0.0a0, !=4.0.0a1 decorator>4.1.2 -fsspec==2023.3.0 +fsspec==2023.5.0 google-auth>=1.2 google-auth-oauthlib google-cloud-storage
