Skip to content

Commit f8dc6e5

Browse files
committed
Fix offset in _normalize_byte_range_index
1 parent 395b0da commit f8dc6e5

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

src/zarr/storage/_utils.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,8 @@ def _normalize_byte_range_index(data: Buffer, byte_range: ByteRangeRequest) -> t
5757
length = byte_range[1] - start
5858
elif "offset" in byte_range:
5959
# See https://github.com/python/mypy/issues/17087 for typeddict-item ignore explanation
60-
length = len(data) - byte_range["offset"] # type: ignore[typeddict-item]
60+
start = byte_range["offset"] # type: ignore[typeddict-item]
61+
length = len(data)
6162
elif "suffix" in byte_range:
6263
start = len(data) - byte_range["suffix"]
6364
length = len(data) - start

0 commit comments

Comments
 (0)