From: Oleg Broytman Date: Mon, 10 Mar 2014 16:22:36 +0000 (+0400) Subject: Remove str() calls X-Git-Tag: v2.5.0~31 X-Git-Url: https://git.phdru.name/?a=commitdiff_plain;h=180a1e42c8b840f489a79d0012cb9ee3d2aa08c3;p=mimedecode.git Remove str() calls No need to convert payloads to strings - non-multipart payloads are always strings. --- diff --git a/mimedecode.py b/mimedecode.py index c85bb8d..c12afbb 100755 --- a/mimedecode.py +++ b/mimedecode.py @@ -291,9 +291,9 @@ def decode_part(msg): encoding = msg["Content-Transfer-Encoding"] if left_binary or encoding in (None, '', '7bit', '8bit', 'binary'): - outstring = str(msg.get_payload()) + outstring = msg.get_payload() else: # Decode from transfer ecoding to text or binary form - outstring = str(msg.get_payload(decode=1)) + outstring = msg.get_payload(decode=1) set_header(msg, "Content-Transfer-Encoding", "8bit") msg["X-MIME-Autoconverted"] = "from %s to 8bit by %s id %s" % (encoding, gopts.host_name, me)