[New-bugs-announce] [issue1483] xml.sax.saxutils.prepare_input_source ignores character stream in InputSource

Yitz Gale report at bugs.python.org
Wed Nov 21 15:03:15 CET 2007


New submission from Yitz Gale:

In the documentation for xml.sax.xmlreader.InputSource objects
(section 8.12.4 of the Library Reference) we find that
users of InputSource objects should use the following
sequence to get their input data:

1. If the InputSource has a character stream, use that.
2. Otherwise, if the InputSource has a byte stream, use that.
3. Otherwise, open a URI connection to the system ID.

prepare_input_source() skips step 1.

This is a one-line fix in Lib/xml/sax/saxutils.py:
-    if source.getByteStream() is None:
+    if source.getCharacterStream is None and source.getByteStream() is 
None:

----------
components: Library (Lib)
messages: 57737
nosy: ygale
severity: normal
status: open
title: xml.sax.saxutils.prepare_input_source ignores character stream in InputSource
versions: Python 2.5

__________________________________
Tracker <report at bugs.python.org>
<http://bugs.python.org/issue1483>
__________________________________


More information about the New-bugs-announce mailing list