Skip to content

Commit

Permalink
fix: strip newline when loading not full list
Browse files Browse the repository at this point in the history
  • Loading branch information
maxzhenzhera committed Apr 2, 2024
1 parent f29ef30 commit d8e8bbe
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion tranco/tranco.py
Original file line number Diff line number Diff line change
Expand Up @@ -130,7 +130,7 @@ def list(self, date: Optional[str] = None, list_id: Optional[str] = None, subdom
if full:
top_list_lines = f.read().splitlines()
else:
top_list_lines = list(islice(f, 1000000))
top_list_lines = [line.rstrip() for line in islice(f, 1000000)]

return TrancoList(date, list_id, list(map(lambda x: x[x.index(',') + 1:], top_list_lines)))

Expand Down

0 comments on commit d8e8bbe

Please sign in to comment.