From 8798312e0472d9109d5086f0d8d1f236610777b8 Mon Sep 17 00:00:00 2001 From: Romain Bignon Date: Mon, 3 Aug 2015 08:48:52 +0200 Subject: [PATCH] force UTF-8 encoding with the standard mechanism --- modules/freemobile/pages/history.py | 9 +-------- 1 file changed, 1 insertion(+), 8 deletions(-) diff --git a/modules/freemobile/pages/history.py b/modules/freemobile/pages/history.py index f1b9a713..571b508e 100644 --- a/modules/freemobile/pages/history.py +++ b/modules/freemobile/pages/history.py @@ -19,8 +19,6 @@ import calendar -from StringIO import StringIO -import lxml.html as html from datetime import datetime from decimal import Decimal @@ -38,12 +36,7 @@ class FormatDate(Filter): class BadUTF8Page(HTMLPage): - def __init__(self, browser, response, *args, **kwargs): - # XXX it is volontary the parent class of HTMLPage's constructor which - # is called, but that's ugly. - super(HTMLPage, self).__init__(browser, response, *args, **kwargs) - parser = html.HTMLParser(encoding='UTF-8') - self.doc = html.parse(StringIO(response.content), parser) + ENCODING = 'UTF-8' class DetailsPage(LoggedPage, BadUTF8Page):