From 09b414d0028a0979133d4ea3a264799f18489bd7 Mon Sep 17 00:00:00 2001 From: frankobe Date: Wed, 7 Jun 2017 15:36:35 -0700 Subject: [PATCH] Fix #3. Increase MAX_LINE_LENGTH --- flanker/mime/message/headers/parsing.py | 2 +- flanker/utils.py | 3 +-- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/flanker/mime/message/headers/parsing.py b/flanker/mime/message/headers/parsing.py index 71f4ec59..5181c0e3 100644 --- a/flanker/mime/message/headers/parsing.py +++ b/flanker/mime/message/headers/parsing.py @@ -6,7 +6,7 @@ from flanker.mime.message.errors import DecodingError from flanker.utils import to_unicode, is_pure_ascii -MAX_LINE_LENGTH = 10000 +MAX_LINE_LENGTH = 20000 def normalize(header): diff --git a/flanker/utils.py b/flanker/utils.py index 25443631..dc52c297 100644 --- a/flanker/utils.py +++ b/flanker/utils.py @@ -53,9 +53,8 @@ def _make_unicode(value, charset=None): try: value = value.decode(charset, "strict") except UnicodeError as e: - print e.reason if e.reason == "unexpected end of data": - raise errors.DecodingDataCorruptionError() + raise errors.DecodingDataCorruptionError(e.reason) value = _guess_and_convert(value) except LookupError as e: