-
Notifications
You must be signed in to change notification settings - Fork 97
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Potential broken approach of reading csv files #286
Comments
FYI, by using |
This seems related to jdunck/python-unicodecsv#65. |
@warwickmm yeah, this is an artifact of using python2, but we should be using python3, so we can remove |
Ok. Do you mind my asking how any of this is working currently? It would seem to me that none of the csv files can be read properly as-is. |
@warwickmm it's a fair question, and the basic answer is that we've mostly not used the core repo in recent times, instead prioritizing the data conversion work that results in the |
Thanks. If the core repo isn't used very much anymore, is there a different repo that I can look at for possible ways to contribute? |
@warwickmm most of our work now is done in various state-specific repos, where we put converted precinct results. For example, we're working on converting official precinct results for Texas here. |
Thank you. I'll take a look at the state-specific repos. |
The following pattern is used often to read csv files:
I think this worked in python2 since the
str
andbytes
types were synonymous. However, this breaks in python3 sinceunicodecsv
expects the file to be opened in binary mode, which it is not.For example, the following fails in python3 with the error
AttributeError: 'str' object has no attribute 'decode'
Using
csv
instead ofunicodecsv
fixes the issue.Is there something wrong with my setup, or is this broken for other people as well?
The text was updated successfully, but these errors were encountered: