R. David Murray added the comment:

I think you can greatly simplify this code by using BytesFeedParser and feeding 
the input to it line by line.  You don't need to gather the headers first, 
since you control how much you read and how much you send to the parser.  The 
change to email is then the handling of lines without colons.  The simplest fix 
is to add a policy control for whether a line-that-doesn't-look-like-a-header 
is considered part of the preceding header or treated as part of the body (or, 
to put it another way, do we really only believe the body starts after a blank 
line or not).  You can make that a setting on Policy, and derive the policy 
used here in http from Compat32, so as to otherwise minimize the behavior 
changes.  If we can't get this done by the beta cutoff on Monday, we can make 
the new policy setting start with an '_' in 3.6, since the point here is the 
bug fix, not the feature; and then make it public in 3.7 (since I think it is 
useful for more than just http).

----------

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

Reply via email to