On 06/06/2008, at 15:14, Guido van Rossum wrote:

On Fri, Jun 6, 2008 at 3:02 AM, Humberto Diogenes <[EMAIL PROTECTED] > wrote:

Is that still necessary?

I can't tell for sure what Barry meant, but this was introduced in
August 2007. Since then, a lot has changed in io.py. Why don't you try
taking it out?

Removing it didn't affect any tests, so I think it can go away now:
http://bugs.python.org/file10537/email.parser-small_fix.patch

BTW, is TextIOWrapper+BufferedReader the right solution to read a string
from a socket?

# In HTTPResponse:
-        self.msg = HTTPMessage(self.fp, 0)
+        parser = email.parser.HeaderParser(_class=HTTPMessage)
+        fp = io.TextIOWrapper(io.BufferedReader(self.fp), 'latin1')
+        self.msg = parser.parse(fp)

Probably. This is what the socket class's own makefile() method does.
Read all about it in socket.py.

I can't use makefile() there, so I believe I did the Right Thing™.

Thanks for the tip, Guido! socket.makefile really is a great demo. :)


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

_______________________________________________
Python-3000 mailing list
Python-3000@python.org
http://mail.python.org/mailman/listinfo/python-3000
Unsubscribe: 
http://mail.python.org/mailman/options/python-3000/archive%40mail-archive.com

Reply via email to