R. David Murray <rdmur...@bitdance.com> added the comment:

I haven't read the http rfcs, but my understanding is that they follow the MIME 
standards, and the email library already has code to do proper parsing and 
decoding of encoded filenames in Content-Disposition headers.  It should be 
possible to call that code for this use case (the http libraries already depend 
on the email libraries, although I'm not sure if cgi itself does currently).  
There may be additional considerations involved in fully supporting the http 
RFCs, but to determine that someone will need to read both and understand them, 
which is not a small undertaking :)

In the meantime, I'm pretty sure that using the existing mime header parsing 
code in the email library (see email.headerregistry) will provide better 
parsing than the only-handles-simple-cases heuristic in your PR.  Granted, I 
don't think you have to deal with multi-part headers in http, but I vaguely 
remember that there are other subtleties not handled by a simple split on '.

----------

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

Reply via email to