Skip to content

Modify UnicodeDecodeError text. You'll use utf-8#6

Merged
wrichert merged 2 commits intoluispedro:masterfrom
neoneo40:unicodedecodeerror_fix
Feb 3, 2015
Merged

Modify UnicodeDecodeError text. You'll use utf-8#6
wrichert merged 2 commits intoluispedro:masterfrom
neoneo40:unicodedecodeerror_fix

Conversation

@neoneo40
Copy link
Copy Markdown
Contributor

I tried to fix UnicodeDecodeError with my valuable a lot of time.
The other people will have to save the time.
Thank you.

p.s: This is My first Pull Request :D

@wrichert
Copy link
Copy Markdown
Collaborator

Thanks, @re4lfl0w. Did you use Python 2.7 or 3?

@neoneo40
Copy link
Copy Markdown
Contributor Author

I use Python 2.7 :D
I know now I realize your question meaning.
Python 3.0 default character set is utf-8.

from platform import python_version
if python_version().startswith('2'):
    text = text.decode('utf-8')

wrichert added a commit that referenced this pull request Feb 3, 2015
Modify UnicodeDecodeError text. Use utf-8 in case of Python version is 2.x.
@wrichert wrichert merged commit e1d2b6d into luispedro:master Feb 3, 2015
@wrichert
Copy link
Copy Markdown
Collaborator

wrichert commented Feb 3, 2015

Thanks, @re4lfl0w!

Just in case you have questions directly to the book itself, feel free to ask them at http://twotoreal.com/u/wr/4/building-machine-learning-systems-in-python/ :-)

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.

2 participants