From 2f5f5a47bcc3cc87ba568ca1ee3107218cb1d6b6 Mon Sep 17 00:00:00 2001 From: Oleg Broytman Date: Sun, 16 Mar 2014 00:22:56 +0400 Subject: [PATCH] Do not recode filename if it isn't recoded yet --- mimedecode.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/mimedecode.py b/mimedecode.py index da63350..50f8a18 100755 --- a/mimedecode.py +++ b/mimedecode.py @@ -270,6 +270,8 @@ def _save_message(msg, outstring, save_headers=False, save_body=False): ): fname = msg.get_param(param, header=header) if fname: + if isinstance(fname, tuple): + fname = fname[2] # Do not recode if it isn't recoded yet try: for forbidden in chr(0), '/', '\\': if forbidden in fname: -- 2.39.5