Added LookupError to the exceptions caught during text upload decoding, leading to upload form validation error.

- Legacy-Id: 16573
This commit is contained in:
Henrik Levkowetz 2019-07-22 15:47:40 +00:00
parent 0170657cf1
commit 915d8e3c2a

View file

@ -225,7 +225,7 @@ class SubmissionBaseUploadForm(forms.Form):
txt_file.seek(0)
try:
text = bytes.decode(self.parsed_info.charset)
except UnicodeDecodeError as e:
except (UnicodeDecodeError, LookupError) as e:
raise forms.ValidationError('Failed decoding the uploaded file: "%s"' % str(e))
#
self.parsed_draft = Draft(text, txt_file.name)