Edward K Ream <[EMAIL PROTECTED]> added the comment:
On Mon, Aug 18, 2008 at 10:09 AM, Benjamin Peterson
<[EMAIL PROTECTED]>wrote:
>
> Benjamin Peterson <[EMAIL PROTECTED]> 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: [EMAIL PROTECTED]
Leo: http://webpages.charter.net/edreamleo/front.html
--------------------------------------------------------------------
Added file: http://bugs.python.org/file11145/unnamed
_______________________________________
Python tracker <[EMAIL PROTECTED]>
<http://bugs.python.org/issue3590>
_______________________________________
<div dir="ltr">On Mon, Aug 18, 2008 at 10:09 AM, Benjamin Peterson <span
dir="ltr"><<a href="mailto:[EMAIL PROTECTED]">[EMAIL
PROTECTED]</a>></span> wrote:<br><div class="gmail_quote"><blockquote
class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin:
0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
<br>
Benjamin Peterson <<a href="mailto:[EMAIL PROTECTED]">[EMAIL
PROTECTED]</a>> added the comment:<br>
<br>
It should probably be changed to just while buffer != b"" since it<br>
requests a byte stream.</blockquote><div><br>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.<br><br>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.<br>
<br>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 :-)<br>
<br>Edward</div></div>--------------------------------------------------------------------<br>Edward
K. Ream email: <a href="mailto:[EMAIL PROTECTED]">[EMAIL
PROTECTED]</a><br>Leo: <a
href="http://webpages.charter.net/edreamleo/front.html">http://webpages.charter.net/edreamleo/front.html</a><br>
--------------------------------------------------------------------<br><br>
</div>
_______________________________________________
Python-bugs-list mailing list
Unsubscribe:
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com