summaryrefslogtreecommitdiff
path: root/src/saml2/response.py
diff options
context:
space:
mode:
authorJohan Lundberg <lundberg@sunet.se>2018-10-18 18:08:09 +0200
committerJohan Lundberg <lundberg@sunet.se>2018-10-19 09:56:34 +0200
commitb62528b7b10747547f393af49afbb2743e916e1a (patch)
tree36922e9207514a775791c02f3c4b457d410f3ca8 /src/saml2/response.py
parent691e981b0ddca9b7d75fa468ef31f494e80c0268 (diff)
downloadpysaml2-b62528b7b10747547f393af49afbb2743e916e1a.tar.gz
Really handle non ascii in response class __str__
Diffstat (limited to 'src/saml2/response.py')
-rw-r--r--src/saml2/response.py7
1 files changed, 4 insertions, 3 deletions
diff --git a/src/saml2/response.py b/src/saml2/response.py
index a8024fef..e1e3edf5 100644
--- a/src/saml2/response.py
+++ b/src/saml2/response.py
@@ -1082,9 +1082,10 @@ class AuthnResponse(StatusResponse):
"session_index": authn_statement.session_index}
def __str__(self):
- if isinstance(self.xmlstr, six.string_types):
- return self.xmlstr
- return str(self.xmlstr)
+ if six.PY2:
+ return self.xmlstr.decode('utf-8')
+ else:
+ return str(self.xmlstr)
def verify_recipient(self, recipient):
"""