From 202d112e0df1021e6ea94bad3c800760489a1634 Mon Sep 17 00:00:00 2001 From: Henrik Levkowetz Date: Mon, 16 Dec 2019 13:32:51 +0000 Subject: [PATCH] Added handling for a decoding exception during submission processing. - Legacy-Id: 17151 --- ietf/submit/parsers/plain_parser.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/ietf/submit/parsers/plain_parser.py b/ietf/submit/parsers/plain_parser.py index c7b0538af..f34394e54 100644 --- a/ietf/submit/parsers/plain_parser.py +++ b/ietf/submit/parsers/plain_parser.py @@ -44,7 +44,10 @@ class PlainParser(FileParser): if self.parsed_info.charset in ['us-ascii', 'utf-8']: while limit: limit -= 1 - line = self.fd.readline().decode(self.parsed_info.charset) + try: + line = self.fd.readline().decode(self.parsed_info.charset) + except UnicodeDecodeError: + return match = draftre.search(line) if not match: continue