Skip to content

Commit 4dedb24

Browse files
authored
Merge pull request #11 from maxzhenzhera/fix/strip-newline-on-not-full-list
fix: strip newline when loading not full list
2 parents f29ef30 + d8e8bbe commit 4dedb24

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

tranco/tranco.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -130,7 +130,7 @@ def list(self, date: Optional[str] = None, list_id: Optional[str] = None, subdom
130130
if full:
131131
top_list_lines = f.read().splitlines()
132132
else:
133-
top_list_lines = list(islice(f, 1000000))
133+
top_list_lines = [line.rstrip() for line in islice(f, 1000000)]
134134

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

0 commit comments

Comments
 (0)