[Python-Dev] [Python-3000] Finishing up PEP 3108

Humberto Diogenes humberto at digi.com.br
Fri May 30 02:25:21 CEST 2008


On 29/05/2008, at 14:32, Brett Cannon wrote:

> On Thu, May 29, 2008 at 12:12 AM, Georg Brandl <g.brandl at gmx.net>  
> wrote:
>>
>>> Issue 2848 - mimetools has been deprecated for a while, but it is
>>> still used in a bunch of places. Since this has been deprecated in  
>>> PEP
>>> 4 for a long time, should we add the removal warning in 2.6 now and
>>> then make its actual removal of usage something to do by another  
>>> beta?
>>>
>>> Issue 2849 - rfc822 is the same problem as mimetools.
>>
>> The problem is that nobody seems to know what exactly distinguishes
>> mimetools/rfc822' classes and its successor's (email's) classes, so
>> it's hard to replace it in the stdlib.
>>
>
> Right. I have looked myself over the years and it never seemed
> brain-dead simple.


Well, as documented in issue 2849, rfc822 is almost gone. I've already  
removed it from mailbox and test_urllib2 modules. It seems that there  
remains only one important use of it, which is in  
cgi.FieldStorage.read_multi().

I couldn't figure out how to replace it there, though, as read_multi's  
current implementation relies on the fact that rfc822.Message(fp)  
advances the file pointer just by the amount it needs, while  
email.parser.Parser.parse() reads the whole file.

I believe that read_multi can be rewritten in a way that's compatible  
with email.parser, but I don't know how to do that... :\

--
Humberto Diógenes
http://humberto.digi.com.br



More information about the Python-Dev mailing list