diff --git a/lti_consumer/outcomes.py b/lti_consumer/outcomes.py index 9f355d0f81cc62a4a52c21907fbaf4b45f2be3fd..e166eb5d703c9020c57acc90134a090ba5a2ca88 100644 --- a/lti_consumer/outcomes.py +++ b/lti_consumer/outcomes.py @@ -12,6 +12,7 @@ from xml.sax.saxutils import escape import six.moves.urllib.error import six.moves.urllib.parse +from six import text_type from lxml import etree from xblockutils.resources import ResourceLoader @@ -42,7 +43,8 @@ def parse_grade_xml_body(body): """ lti_spec_namespace = "http://www.imsglobal.org/services/ltiv1p1/xsd/imsoms_v1p0" namespaces = {'def': lti_spec_namespace} - data = body.strip().encode('utf-8') + if isinstance(body, text_type): + data = body.strip().encode('utf-8') try: parser = etree.XMLParser(ns_clean=True, recover=True, encoding='utf-8') # pylint: disable=no-member diff --git a/setup.py b/setup.py index 8ed60ef2a9e67310b9d83ca85006090b5cea6631..6b8a22fe7bd089674e545544569891b31e7caf99 100644 --- a/setup.py +++ b/setup.py @@ -25,7 +25,7 @@ def package_data(pkg, roots): setup( name='lti_consumer-xblock', - version='1.2.1', + version='1.2.2', description='This XBlock implements the consumer side of the LTI specification.', packages=[ 'lti_consumer',