Skip to content

Commit

Permalink
Add safeguard to csv parser
Browse files Browse the repository at this point in the history
  • Loading branch information
webb-ben committed Mar 7, 2024
1 parent b47c55e commit 395563b
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion sitemap_generator/util.py
Original file line number Diff line number Diff line change
Expand Up @@ -145,7 +145,7 @@ def parse(filename: Path, n: int = 50000) -> list:
with filename.open('r') as fh:
csv_reader = csv.reader(fh)
headers = [h.strip() for h in next(csv_reader)] # noqa
lines = [line for line in csv_reader]
lines = [line for line in csv_reader if line]
return chunkify(lines, n)


Expand Down

0 comments on commit 395563b

Please sign in to comment.