From 11c9d974852d4e643ee63bd4b26f8af6dcea7a41 Mon Sep 17 00:00:00 2001 From: Oleg Broytman Date: Fri, 29 Jul 2016 01:14:45 +0300 Subject: [PATCH] Use bytes.decode() for Python 3 compatibility --- mimedecode.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mimedecode.py b/mimedecode.py index ce4b288..64e2184 100755 --- a/mimedecode.py +++ b/mimedecode.py @@ -35,7 +35,7 @@ def output_headers(msg): def recode_if_needed(s, charset): if charset and charset.lower() != g.default_encoding: - s = unicode(s, charset, "replace").encode(g.default_encoding, "replace") + s = s.decode(charset, "replace").encode(g.default_encoding, "replace") return s -- 2.39.5