From d5f208c1dcb1f09f1e4d2b744e63807c87dac4b1 Mon Sep 17 00:00:00 2001 From: "Stefan Rijnhart (Opener)" Date: Tue, 20 Apr 2021 14:20:43 +0200 Subject: [PATCH] [FIX] openupgrade_record: catch UnicodeDecodeError exceptions MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-authored-by: Miquel Raïch --- .../openupgrade_records/models/openupgrade_record.py | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/odoo/addons/openupgrade_records/models/openupgrade_record.py b/odoo/addons/openupgrade_records/models/openupgrade_record.py index 3c12dadaa64..30a112763a1 100644 --- a/odoo/addons/openupgrade_records/models/openupgrade_record.py +++ b/odoo/addons/openupgrade_records/models/openupgrade_record.py @@ -148,6 +148,9 @@ def get_xml_records(self, module): if not xml_file.lower().endswith('.xml'): continue parts = xml_file.split('/') - with open(os.path.join(addon_dir, *parts), 'r') as xml_handle: - files.append(xml_handle.read()) + try: + with open(os.path.join(addon_dir, *parts), 'r') as xml_handle: + files.append(xml_handle.read()) + except UnicodeDecodeError: + continue return files