From 907f0fe7b7870db673859f881b8dedb8ed82c12f Mon Sep 17 00:00:00 2001 From: Jan Philipp Timme Date: Thu, 30 Jan 2020 15:04:24 +0100 Subject: [PATCH] Fix error handling for decoding errors --- main.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/main.py b/main.py index d51952b..87ea78f 100644 --- a/main.py +++ b/main.py @@ -34,7 +34,7 @@ def get_decoded_header(value): for item in decoded_header_items: decoded_item = item[0].decode(item[1]) if item[1] is not None else item[0] if isinstance(decoded_item, bytes): - decoded_item = decoded_item.decode('ascii') + decoded_item = decoded_item.decode('ascii', 'replace') decoded_header_value += decoded_item return decoded_header_value