Skip to content

Commit

Permalink
[FIX] openupgrade_record: catch UnicodeDecodeError exceptions
Browse files Browse the repository at this point in the history
Co-authored-by: Miquel Raïch <[email protected]>
  • Loading branch information
StefanRijnhart and MiquelRForgeFlow committed Apr 21, 2021
1 parent e31672c commit d5f208c
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions odoo/addons/openupgrade_records/models/openupgrade_record.py
Original file line number Diff line number Diff line change
Expand Up @@ -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

0 comments on commit d5f208c

Please sign in to comment.