[New-bugs-announce] [issue39040] Wrong filename in when mime header was too long
report at bugs.python.org
Fri Dec 13 11:59:51 EST 2019
New submission from Manfred Kaiser <manfred.kaiser at logfile.at>:
I'm working on a mailfilter in python and used the method "get_filename" of the "EmailMessage" class.
In some cases a wrong filename was returned. The reason was, that the Content-Disposition Header had a line break and the following intention was interpreted as part of the filename.
After fixing this bug, I was able to get the right filename.
I had to change "linesep_splitter" in "email.policy" to match the intention.
linesep_splitter = re.compile(r'\n|\r')
linesep_splitter = re.compile(r'\n\s+|\r\s+')
nosy: barry, mkaiser, r.david.murray
title: Wrong filename in when mime header was too long
versions: Python 3.5, Python 3.6, Python 3.7, Python 3.8
Python tracker <report at bugs.python.org>
More information about the New-bugs-announce