diff --git a/.github/workflows/build-test.yml b/.github/workflows/build-test.yml index 486c85f9d..6a766e3c4 100644 --- a/.github/workflows/build-test.yml +++ b/.github/workflows/build-test.yml @@ -10,7 +10,7 @@ jobs: build: strategy: matrix: - platform: ["ubuntu-latest", "macos-latest", "windows-latest"] + platform: ["windows-latest", "macos-latest", "ubuntu-latest"] python-version: ["3.5", "3.6", "3.7", "3.8"] exclude: - platform: "macos-latest" diff --git a/tests/test_0066-fix-http-fallback-freeze.py b/tests/test_0066-fix-http-fallback-freeze.py new file mode 100644 index 000000000..ff8a30e48 --- /dev/null +++ b/tests/test_0066-fix-http-fallback-freeze.py @@ -0,0 +1,15 @@ +# BSD 3-Clause License; see https://github.com/scikit-hep/uproot4/blob/master/LICENSE + +from __future__ import absolute_import + +import numpy +import pytest + +import uproot4 + + +@pytest.mark.network +def test(): + with uproot4.open("http://scikit-hep.org/uproot/examples/HZZ.root:events") as t: + t["MET_px"].array() + t["MET_py"].array() diff --git a/uproot4/behaviors/TBranch.py b/uproot4/behaviors/TBranch.py index 0dadcbfc8..538a3bad2 100644 --- a/uproot4/behaviors/TBranch.py +++ b/uproot4/behaviors/TBranch.py @@ -500,10 +500,7 @@ def basket_to_array(basket): notifications.put(None) while len(arrays) < len(branchid_interpretation): - try: - obj = notifications.get(timeout=0.001) - except queue.Empty: - continue + obj = notifications.get() if isinstance(obj, uproot4.source.chunk.Chunk): chunk = obj diff --git a/uproot4/source/futures.py b/uproot4/source/futures.py index 297c82b83..a9590bc1a 100644 --- a/uproot4/source/futures.py +++ b/uproot4/source/futures.py @@ -310,6 +310,7 @@ def run(self): future._result = future._task(self._resource) except Exception: future._excinfo = sys.exc_info() + future._set_finished() diff --git a/uproot4/source/http.py b/uproot4/source/http.py index 6011cc552..9ddc5bba8 100644 --- a/uproot4/source/http.py +++ b/uproot4/source/http.py @@ -663,7 +663,9 @@ def chunks(self, ranges, exact=True, notifications=None): self._num_requested_bytes += sum(stop - start for start, stop in ranges) if self._worker.fallback is not None: - return self._worker.fallback.chunks(ranges) + return self._worker.fallback.chunks( + ranges, exact=exact, notifications=notifications + ) else: range_strings = []