Skip to content

Commit

Permalink
Merge pull request #247 from cisaacstern/remove-block-size-error
Browse files Browse the repository at this point in the history
Remove BlockSizeError following fsspec 2021.11.1 release
  • Loading branch information
cisaacstern authored Nov 29, 2021
2 parents aad2f0f + d294f00 commit 5355479
Showing 1 changed file with 1 addition and 8 deletions.
9 changes: 1 addition & 8 deletions pangeo_forge_recipes/storage.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@
from urllib.parse import parse_qs, urlencode, urlparse, urlunparse

import fsspec
from fsspec.implementations.http import BlockSizeError

logger = logging.getLogger(__name__)

Expand All @@ -38,13 +37,7 @@ def _copy_btw_filesystems(input_opener, output_opener, BLOCK_SIZE=10_000_000):
interval = 5 # seconds
bytes_read = log_count = 0
while True:
try:
data = source.read(BLOCK_SIZE)
except BlockSizeError as e:
raise ValueError(
"Server does not permit random access to this file via Range requests. "
'Try re-instantiating recipe with `fsspec_open_kwargs={"block_size": 0}`'
) from e
data = source.read(BLOCK_SIZE)
if not data:
break
target.write(data)
Expand Down

0 comments on commit 5355479

Please sign in to comment.