work around encoding error

This commit is contained in:
Benjamin Dauvergne 2012-11-06 16:45:00 +01:00
parent 6bd60fbfe4
commit 28786d1e5f
1 changed files with 2 additions and 2 deletions

View File

@ -35,7 +35,7 @@ class BlackboardConnector(object):
def _get_course_helper(self, r):
r.encoding = 'utf-8'
if r.status_code == 200 and r.content.startswith('<'):
x = etree.XML(r.content)
x = etree.XML(r.content.replace('ISO-8859-1', 'UTF-8'))
info_message_elt = x.find('infoMessage')
course_elts = x.findall('*/course')
courses = []
@ -117,7 +117,7 @@ class BlackboardConnector(object):
def get_categories(self):
r = self.send_request('GetCategories')
if r.status_code == 200 and r.content.startswith('<'):
x = etree.XML(r.content)
x = etree.XML(r.content.replace('ISO-8859-1', 'UTF-8'))
info_message_elt = x.find('infoMessage')
category_elts = x.findall('categories/category')
categories = []