Skip to content

Commit 4612d77

Browse files
authored
skip empty files in read_bytes.py (#1993)
Signed-off-by: siyuan0322 <[email protected]>
1 parent 4b633fd commit 4612d77

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

python/vineyard/drivers/io/adaptors/read_bytes.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -180,6 +180,12 @@ def read_bytes( # noqa: C901, pylint: disable=too-many-statements
180180
try:
181181
for index, file_path in enumerate(files):
182182
with fs.open(file_path, mode="rb") as fp:
183+
try:
184+
total_size = fp.size()
185+
except TypeError:
186+
total_size = fp.size
187+
if total_size == 0:
188+
continue
183189
offset = 0
184190
offset_adjustment = 0
185191
# Only process header line when processing first file

0 commit comments

Comments
 (0)