From b57c516f2ab11299dc4d3b1a89e0fe3f003fffed0e9ad7f430c934a322020ce5 Mon Sep 17 00:00:00 2001 From: Matej Cepl Date: Sat, 28 Aug 2021 10:41:31 +0000 Subject: [PATCH] Accepting request 913875 from home:bnavigator:branches:devel:languages:python:numeric - Add fsspec-pr710-bytesreturn.patch in order to fix zarr * gh#intake/filesystem_spec#710 * gh#zarr-developers/zarr-python#812 OBS-URL: https://build.opensuse.org/request/show/913875 OBS-URL: https://build.opensuse.org/package/show/devel:languages:python/python-fsspec?expand=0&rev=28 --- fsspec-pr710-bytesreturn.patch | 22 ++++++++++++++++++++++ python-fsspec.changes | 7 +++++++ python-fsspec.spec | 4 +++- 3 files changed, 32 insertions(+), 1 deletion(-) create mode 100644 fsspec-pr710-bytesreturn.patch diff --git a/fsspec-pr710-bytesreturn.patch b/fsspec-pr710-bytesreturn.patch new file mode 100644 index 0000000..e232e4e --- /dev/null +++ b/fsspec-pr710-bytesreturn.patch @@ -0,0 +1,22 @@ +From 576008ff849392c1c801b0722d595a2369e11797 Mon Sep 17 00:00:00 2001 +From: Davis Vann Bennett +Date: Wed, 14 Jul 2021 19:53:48 -0400 +Subject: [PATCH] check for bytes return type and dictifiy it + +--- + fsspec/mapping.py | 2 ++ + 1 file changed, 2 insertions(+) + +diff --git a/fsspec/mapping.py b/fsspec/mapping.py +index 17fe7ae7..235da8d2 100644 +--- a/fsspec/mapping.py ++++ b/fsspec/mapping.py +@@ -88,6 +88,8 @@ def getitems(self, keys, on_error="raise"): + oe = on_error if on_error == "raise" else "return" + try: + out = self.fs.cat(keys2, on_error=oe) ++ if isinstance(out, bytes): ++ out = {keys2[0]: out} + except self.missing_exceptions as e: + raise KeyError from e + out = { diff --git a/python-fsspec.changes b/python-fsspec.changes index 115c878..672e087 100644 --- a/python-fsspec.changes +++ b/python-fsspec.changes @@ -1,3 +1,10 @@ +------------------------------------------------------------------- +Mon Aug 23 17:04:01 UTC 2021 - Ben Greiner + +- Add fsspec-pr710-bytesreturn.patch in order to fix zarr + * gh#intake/filesystem_spec#710 + * gh#zarr-developers/zarr-python#812 + ------------------------------------------------------------------- Sun Aug 8 15:32:54 UTC 2021 - Ben Greiner diff --git a/python-fsspec.spec b/python-fsspec.spec index 008aff6..381bc7c 100644 --- a/python-fsspec.spec +++ b/python-fsspec.spec @@ -35,6 +35,8 @@ License: BSD-3-Clause URL: https://github.com/intake/filesystem_spec # the tests are only in the GitHub archive Source: %{url}/archive/%{ghversion}.tar.gz#/fsspec-%{ghversion}.tar.gz +# PATCH-FIX-UPSTREAM fsspec-pr710-bytesreturn.patch -- gh#intake/filesystem_spec#710 and gh#zarr-developers/zarr-python#812 +Patch0: %{url}/pull/710.patch#/fsspec-pr710-bytesreturn.patch BuildRequires: %{python_module base >= 3.6} BuildRequires: %{python_module importlib_metadata if %python-base < 3.8} BuildRequires: %{python_module setuptools} @@ -83,7 +85,7 @@ BuildRequires: %{python_module panel if (%python-base without python36-base)} A specification for pythonic filesystems. %prep -%setup -q -n filesystem_spec-%{ghversion} +%autosetup -p1 -n filesystem_spec-%{ghversion} # don't test nonexistent python36-numpy sed -i -e '/^import numpy as np/ d' -e '/^import pytest/ a np = pytest.importorskip("numpy")' fsspec/tests/test_spec.py