From dc4455bec5ce76c58e48c36c3a8be234172aeb27 Mon Sep 17 00:00:00 2001 From: Edward Betts Date: Tue, 30 Jun 2020 13:09:03 +0100 Subject: [PATCH] Catch and ignore UnicodeDecodeError in wd_catalog --- depicts/wd_catalog.py | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/depicts/wd_catalog.py b/depicts/wd_catalog.py index 41ac34c..87ccd74 100644 --- a/depicts/wd_catalog.py +++ b/depicts/wd_catalog.py @@ -153,12 +153,15 @@ def check_catalog(entity, catalog): catalog.update(cat) return - html = get_catalog_url(catalog_url) - if html: - description = get_description_from_page(html) - if description: - catalog['description'] = description - return + try: + html = get_catalog_url(catalog_url) + if html: + description = get_description_from_page(html) + if description: + catalog['description'] = description + return + except UnicodeDecodeError: + return for property_id in sorted(catalog_ids): if property_id == 'P350':