Skip to content
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

encoding error #1

Open
derikon opened this issue Sep 11, 2017 · 3 comments
Open

encoding error #1

derikon opened this issue Sep 11, 2017 · 3 comments

Comments

@derikon
Copy link

derikon commented Sep 11, 2017

I encountered a problem with encoding while reading and writing csv files.
There is an associated error file for each city:

Traceback (most recent call last):
  File "./AirImport/importer.py", line 153, in get_csv_data
    f.write(data)
UnicodeEncodeError: 'ascii' codec can't encode character '\xb5' in position 34: ordinal not in range(128)
@evilham
Copy link
Contributor

evilham commented Oct 11, 2017

:-D sorry about the delay. Which python version are you using? I've been running this on 3.4 without issues.

When you confirm the python version, I'll try to replicate the error, try your PR and quite probably merge it, thank you!

@derikon
Copy link
Author

derikon commented Oct 21, 2017

I'm using python 3.6.1

@Mic92
Copy link

Mic92 commented Oct 22, 2017

Please use a unicode enabled system locale: export LC_ALL=en_US.utf-8 and also make sure this local is enabled in /etc/locale.gen. Otherwise python will assume ASCII encoding when opening files, which results in the error you see above.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants