Skip to content

Commit ffe9afd

Browse files
Update roboflow/util/folderparser.py
Co-authored-by: Iuri de Silvio <[email protected]>
1 parent 7572e67 commit ffe9afd

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

roboflow/util/folderparser.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -215,12 +215,14 @@ def _loadAnnotations(folder, annotations):
215215
def _read_jsonl(path):
216216
data = []
217217
with open(path) as file:
218-
for line in file:
218+
for linenum, line in enumerate(file, 1):
219+
if not line:
220+
continue
219221
try:
220222
json_object = json.loads(line.strip())
221223
data.append(json_object)
222224
except json.JSONDecodeError:
223-
print(f"Warning: Skipping invalid JSON line in {path}")
225+
print(f"Warning: Skipping invalid JSON line in {path}:{linenum}")
224226
return data
225227

226228

0 commit comments

Comments
 (0)