Skip to content
This repository was archived by the owner on Aug 18, 2025. It is now read-only.
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions geotext/geotext.py
Original file line number Diff line number Diff line change
Expand Up @@ -42,13 +42,13 @@ def read_table(filename, usecols=(0, 1), sep='\t', comment='#', encoding='utf-8'
A dictionary with the same length as the number of lines in `filename`
"""

with open(filename, 'r') as f:
with open(filename, 'rb') as f:
# skip initial lines
for _ in range(skip):
next(f)

# filter comment lines
lines = (line for line in f if not line.startswith(comment))
# filter comment lines (removes BOM during comment checking, but leaves it in capturing)
lines = (line.decode(encoding) for line in f if not line.decode(encoding).replace(u'\ufeff','').startswith(comment))

d = dict()
for line in lines:
Expand Down