btimby / fulltext

Python library for extracting text from various file formats (for indexing).
MIT License
111 stars 24 forks source link

Universal newlines for CSV #68

Closed btimby closed 6 years ago

btimby commented 6 years ago

This error occurs when the CSV file uses different newlines than the OS default. While Python has universal newlines support (open(..., mode='rU')). We are passed a file that is already open. Thus we need to split the lines in a way that supports all newline methods.

https://sentry00.dev.veristack.com/veristack/ncaa/issues/258/

.splitlines() is more robust than .readlines(), so that may be an option to use rather than reopening the file.

giampaolo commented 6 years ago

Fixed by #70. Closing.