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

fix Unicode error #12

Open
wants to merge 4 commits into
base: master
Choose a base branch
from

Conversation

harrypotterismyname
Copy link

No description provided.

@mkwiatkowski
Copy link
Owner

I don't think this is the right solution. Please see http://stackoverflow.com/questions/3828723/why-should-we-not-use-sys-setdefaultencodingutf-8-in-a-py-script Using unicode() in place of str() and using .decode('utf-8') where applicable is a better solution.

@harrypotterismyname
Copy link
Author

harrypotterismyname commented Nov 14, 2016

@mkwiatkowski you can check the second answer for this question
http://stackoverflow.com/questions/28657010/dangers-of-sys-setdefaultencodingutf-8

Setting the defaultencoding to UTF-8 nowadays is safe, except for specialised applications, handling files from non unicode ready systems.

The "official" rejection of the switch is based on reasons no longer relevant for a vast majority of end users (not library providers), so we should stop discouraging users to set it.

@mkwiatkowski
Copy link
Owner

I don't agree with the reasoning presented in the stack overflow post you linked. Anyway, since there is only one place in code where this is needed, using decode here will be shorter than putting reload+setdefaultencoding in three different files.

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

Successfully merging this pull request may close these issues.

3 participants