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

problematic String.serialize/deserialize behaviour for bytes in python 3 #251

Open
novocaine opened this issue Jan 26, 2016 · 0 comments
Open

Comments

@novocaine
Copy link

If colander.String() is passed bytes data on python 3 and self.encoding is None, it does str() on the bytes object.

This is almost always undesirable on python 3 as, unlike python 2, there is no implicit encoding peformed and instead you get a 'b' and some quotes whacked in:

>>> str(b'test')
"b'test'"

Note that if the interpreter is running with -b or -bb this is a warning or an error respectively.

In my view, colander should raise an Exception in this case under python 3 as there is no sane way to make it into an actual string in the absence of an encoding.

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

1 participant