Update CSV reader logic to work with Python 3 #11
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
I think Heroku forcibly upgraded grorg to Python 3, which broke CSV loading.
Because the type of the
csv_obj.csv
field will be abytes
, we need to decode that into a utf-8str
before passing it intocsv.reader()
. This avoids the headers being parsed incorrectly, such as the first field being namedb'My Field
.This also fixes migrations to work with Python 3 and replaces
__unicode__
with__str__
CSV parsing works now!
