]> git.phdru.name Git - mimedecode.git/commitdiff
Do not recode filename if it isn't recoded yet
authorOleg Broytman <phd@phdru.name>
Sat, 15 Mar 2014 20:22:56 +0000 (00:22 +0400)
committerOleg Broytman <phd@phdru.name>
Sat, 15 Mar 2014 20:22:56 +0000 (00:22 +0400)
mimedecode.py

index da63350485e7981713b88257bbccc12bb711efd2..50f8a18675a5265700f2f4928208e169dc116f8d 100755 (executable)
@@ -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: