diff --git a/NEWS b/NEWS index e4caab81..de089efa 100644 --- a/NEWS +++ b/NEWS @@ -1,5 +1,9 @@ coming in the next release: +6.0.4 - 13 June 2021 + * Prevent a UnicodeDecodeError crash that may occur when + the title element's type attribute exists but is empty. (#277) + 6.0.3 - 12 June 2021 * Fix an issue with the HTTP request status on Python >= 3.9. diff --git a/feedparser/mixin.py b/feedparser/mixin.py index 5f5c8607..49db2be8 100644 --- a/feedparser/mixin.py +++ b/feedparser/mixin.py @@ -506,9 +506,7 @@ def pop(self, element, strip_whitespace=1): if base64 and self.contentparams.get('base64', 0): try: output = base64.decodebytes(output.encode('utf8')).decode('utf8') - except binascii.Error: - pass - except binascii.Incomplete: + except (binascii.Error, binascii.Incomplete, UnicodeDecodeError): pass # resolve relative URIs