From aea58b48d7061da8ded256f6960bd336b40d235d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?C=C3=A9dric=20Krier?= Date: Mon, 30 Oct 2017 11:18:51 +0100 Subject: [PATCH] Decode CODA file content before parsing it issue6884 review37781002 --- account.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/account.py b/account.py index 9f013382db..095f3b4cd5 100644 --- a/account.py +++ b/account.py @@ -34,7 +34,10 @@ class StatementImport: }) def parse_coda(self, encoding='windows-1252'): - file_ = StringIO(unicode(self.start.file_, encoding=encoding)) + file_ = self.start.file_ + if not isinstance(file_, unicode): + file_ = file_.decode(encoding) + file_ = StringIO(file_) coda = CODA(file_) for coda_statement in coda.statements: statement = self.coda_statement(coda_statement)