On Mon, Aug 18, 2008 at 10:09 AM, Benjamin Peterson <report@bugs.python.org> wrote:

Benjamin Peterson <musiccomposition@gmail.com> added the comment:

It should probably be changed to just while buffer != b"" since it
requests a byte stream.

That was my guess as well.  I added the extra test so as not to remove a test that might, under some circumstance be important.

Just to be clear, I am at present totally confused about io streams :-)  Especially as used by the sax parsers.  In particular, opening a file in 'r' mode, that is, passing a *non*-byte stream to parser.parse, works, while opening a file in 'rb' mode, that is, passing a *byte* stream to parser.parse, hangs.

Anyway, opening the file passed to parser.parse with 'r' mode looks like the (only) way to go when using Python 3.0.  In Python 2.5, opening files passed to parser.parse in 'rb' mode works.  I don't recall whether I had any reason for 'rb' mode: it may have been an historical accident, or just a lucky accident :-)

Edward
--------------------------------------------------------------------
Edward K. Ream email: edreamleo@gmail.com
Leo: http://webpages.charter.net/edreamleo/front.html
--------------------------------------------------------------------