Skip to content

Commit

Permalink
skip empty files in read_bytes.py (#1993)
Browse files Browse the repository at this point in the history
Signed-off-by: siyuan0322 <[email protected]>
  • Loading branch information
siyuan0322 authored Aug 29, 2024
1 parent 4b633fd commit 4612d77
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions python/vineyard/drivers/io/adaptors/read_bytes.py
Original file line number Diff line number Diff line change
Expand Up @@ -180,6 +180,12 @@ def read_bytes( # noqa: C901, pylint: disable=too-many-statements
try:
for index, file_path in enumerate(files):
with fs.open(file_path, mode="rb") as fp:
try:
total_size = fp.size()
except TypeError:
total_size = fp.size
if total_size == 0:
continue
offset = 0
offset_adjustment = 0
# Only process header line when processing first file
Expand Down

0 comments on commit 4612d77

Please sign in to comment.