From 8cbdd1fa29f956f28f076ddfc126a85481625d96 Mon Sep 17 00:00:00 2001 From: Romain Bignon Date: Sun, 10 Feb 2013 21:57:24 +0100 Subject: [PATCH] fix unicode issue --- modules/creditdunord/pages.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/modules/creditdunord/pages.py b/modules/creditdunord/pages.py index a35f8398..7166de6d 100644 --- a/modules/creditdunord/pages.py +++ b/modules/creditdunord/pages.py @@ -75,7 +75,8 @@ class AccountsPage(CDNBasePage): for line in data: a = Account() a.id = line[self.COL_ID].replace(' ','') - a.label = self.parser.tocleanstring(self.parser.parse(StringIO(line[self.COL_LABEL])).xpath('//div[@class="libelleCompteTDB"]')[0]) + fp = StringIO(unicode(line[self.COL_LABEL]).encode(self.browser.ENCODING)) + a.label = self.parser.tocleanstring(self.parser.parse(fp, self.browser.ENCODING).xpath('//div[@class="libelleCompteTDB"]')[0]) a.balance = Decimal(FrenchTransaction.clean_amount(line[self.COL_BALANCE])) a._link = self.get_history_link() a._execution = self.get_execution()