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 UnicodeDecodeError, which can occur on serializer repr. #2279

Merged
merged 2 commits into from Dec 15, 2014

Conversation

tomchristie
Copy link
Member

Closes #2270.

We're now using unicode internally everywhere when building the repr and only coercing to str (for python 2) immediately prior to returning.

@tomchristie tomchristie added this to the 3.0.2 Release milestone Dec 15, 2014
@@ -1,3 +1,4 @@
from __future__ import unicode_literals
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Isn't this line enough for both py2 and py3 ?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No. Python 2 expects repr to return str values. Given that we're using unicode throughout, we need to forcibly coerce those immediate prior to returning the values.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Forget about my previous comment, I was doing conversions the wrong way in the repr.

tomchristie added a commit that referenced this pull request Dec 15, 2014
…-bug

Use unicode internally everywhere for 'repr'.
@tomchristie tomchristie merged commit af53e34 into master Dec 15, 2014
@tomchristie tomchristie deleted the fix-serializer-repr-unicode-bug branch December 15, 2014 12:04
@tomchristie tomchristie changed the title Use unicode internally everywhere for 'repr'. Fix UnicodeDecodeError, which can occur on serializer repr. Dec 15, 2014
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Fix UnicodeDecodeError, which can occur on serializer repr.
2 participants