From: Oleg Broytman Date: Sat, 15 Mar 2014 20:22:56 +0000 (+0400) Subject: Do not recode filename if it isn't recoded yet X-Git-Tag: v2.5.0~8 X-Git-Url: https://git.phdru.name/?a=commitdiff_plain;h=2f5f5a47bcc3cc87ba568ca1ee3107218cb1d6b6;p=mimedecode.git Do not recode filename if it isn't recoded yet --- 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: