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

Correctly decode bytestrings in Python 3 #365

Merged
merged 1 commit into from
Nov 24, 2015

Conversation

bintoro
Copy link
Member

@bintoro bintoro commented Nov 22, 2015

Fixes and simplifies Unicode routines. Also adds tests which were
notably absent.


Before patch

Python 2:

>>> StringType()('\xc3\xa4').encode('utf-8')
'\xc3\xa4'

Python 3:

>>> StringType()(b'\xc3\xa4').encode('utf-8')
Traceback (most recent call last):
  ...
schematics.exceptions.ConversionError: ["Couldn't interpret 'b'\\xc3\\xa4'' as string."]

Fixes and simplifies Unicode routines. Also adds tests which were
notably absent.
@bintoro
Copy link
Member Author

bintoro commented Nov 24, 2015

This seems like an uncontroversial bugfix, so merging.

bintoro added a commit that referenced this pull request Nov 24, 2015
Correctly decode bytestrings in Python 3
@bintoro bintoro merged commit 84dd749 into schematics:development Nov 24, 2015
@bintoro bintoro deleted the py3-unicode branch February 15, 2016 14:10
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.

None yet

1 participant