New submission from Manfred Kaiser <manfred.kai...@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.

Old Value:

linesep_splitter = re.compile(r'\n|\r')


New Value:

linesep_splitter = re.compile(r'\n\s+|\r\s+')

----------
components: email
messages: 358343
nosy: barry, mkaiser, r.david.murray
priority: normal
severity: normal
status: open
title: Wrong filename in when mime header was too long
type: behavior
versions: Python 3.5, Python 3.6, Python 3.7, Python 3.8

_______________________________________
Python tracker <rep...@bugs.python.org>
<https://bugs.python.org/issue39040>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to