Skip to content

Commit

Permalink
Merge pull request #11 from maxzhenzhera/fix/strip-newline-on-not-ful…
Browse files Browse the repository at this point in the history
…l-list

fix: strip newline when loading not full list
  • Loading branch information
VictorLeP authored Apr 2, 2024
2 parents f29ef30 + d8e8bbe commit 4dedb24
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 4dedb24

Please sign in to comment.