-
Notifications
You must be signed in to change notification settings - Fork 446
Handle non ascii in response class __str__ #553
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
Handle non ascii in response class __str__ #553
Conversation
|
I have filled issue #2902 with PyPy3 for the failing build. |
src/saml2/response.py
Outdated
| if six.PY2: | ||
| return str(self.xmlstr).decode('utf-8') | ||
| else: | ||
| return str(self.xmlstr) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
self.xmlstr should always be a str. str(self.xmlstr) will always result to the same value as self.xmlstr. str(...) shouldn't be needed here.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I agree, but is it a should or would ;). I will update my PR as I can't find any way for self.xmlstr to be anything other than a string as you say.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We where not quite right as self.xmlstr can be bytes when using Python 3.x. The test that was failing was test_flow in test_65_authn_query.
de92b7a to
b62528b
Compare
Signed-off-by: Ivan Kanakarakis <ivan.kanak@gmail.com>
Signed-off-by: Ivan Kanakarakis <ivan.kanak@gmail.com>
|
I merged this, ignoring the failing case for pypy3. There is nothing we can do about it. It is up to travis-ci to update their image and upgrade pypy3 to a stable version. For reference As for the PR itself, I opted to store |
|
Sounds good. Thank you! |
I was apparently confused in my last PR (#550) when I tried to fix the response class
__str__.This should (hopefully) be the correct way of handling a response string containing non ascii characters.
All Submissions: