author | Alberto Bertogli
<albertito@blitiri.com.ar> 2010-05-09 00:43:00 UTC |
committer | Alberto Bertogli
<albertito@blitiri.com.ar> 2010-05-09 00:43:00 UTC |
parent | a74898f3cdc89f6663015118487010d95c8f42a4 |
sea | +3 | -1 |
diff --git a/sea b/sea index 12dbf48..22d14ea 100755 --- a/sea +++ b/sea @@ -50,7 +50,9 @@ def main(infd, basepath): os.mkdir(outpath) fname = part.get_filename('') - if not fname: + # "=?" tells us that the name is broken (an attempt to encode + # it that went wrong), so just assign a name ourselves + if not fname or "=?" in fname: ext = mimetypes.guess_extension( part.get_content_type() ) fname = 'att-%d.%s' % (count, ext)