From 9223d91fbb1cab2dc3d050fa3b485101b8fd3fad Mon Sep 17 00:00:00 2001 From: Yoann Guillard Date: Wed, 3 Jun 2020 17:59:22 +0200 Subject: [PATCH] [creditdunord] Encoding issue compatibility python 2/3 when weboob was lauched by python 3, the accounts' id was containing bytestring (eg : 123456789b'0'b'1' instead of 12345678901) this created a new account and deleted the older one so when the client wanted to access/actived it, he had an error then we switched the client on his new account in the backend, but the problem occured again when it forced a synchronisation The automatic sync and the forced one do not use the same python version this issue came from the use of : weboob.tools.compat.unicode(my_str).encode('utf-8') resolved by : weboob.tools.misc.to_unicode(my_str) --- 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 bbf0912b5e..3ba0134446 100755 --- a/modules/creditdunord/pages.py +++ b/modules/creditdunord/pages.py @@ -43,6 +43,7 @@ from weboob.tools.capabilities.bank.investments import is_isin_valid from weboob.tools.captcha.virtkeyboard import GridVirtKeyboard from weboob.tools.compat import quote, unicode +from weboob.tools.misc import to_unicode from weboob.tools.json import json @@ -484,7 +485,7 @@ def params_from_js(self, text): args[input.attrib['name']] = input.attrib.get('value', '') for i, key in enumerate(self.ARGS): - args[key] = unicode(l[self.ARGS.index(key)]).encode(self.browser.ENCODING) + args[key] = to_unicode(l[self.ARGS.index(key)]) args['PageDemandee'] = 1 args['PagePrecedente'] = 1 -- GitLab