diff options
author | Serhiy Storchaka <storchaka@gmail.com> | 2015-04-02 18:00:13 (GMT) |
---|---|---|
committer | Serhiy Storchaka <storchaka@gmail.com> | 2015-04-02 18:00:13 (GMT) |
commit | 61de087f0f838f5b69592827d3d592c06aa9b655 (patch) | |
tree | 302f1a8799a529de0213a395e30fb4705b53f6bf /Doc/library/xml.sax.reader.rst | |
parent | 278ba2690c9367d36f138c880130aa1390fbaa19 (diff) | |
download | cpython-61de087f0f838f5b69592827d3d592c06aa9b655.zip cpython-61de087f0f838f5b69592827d3d592c06aa9b655.tar.gz cpython-61de087f0f838f5b69592827d3d592c06aa9b655.tar.bz2 |
Issue #2175: SAX parsers now support a character stream of InputSource object.
Diffstat (limited to 'Doc/library/xml.sax.reader.rst')
-rw-r--r-- | Doc/library/xml.sax.reader.rst | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/Doc/library/xml.sax.reader.rst b/Doc/library/xml.sax.reader.rst index 3ab6063..31ca260 100644 --- a/Doc/library/xml.sax.reader.rst +++ b/Doc/library/xml.sax.reader.rst @@ -100,8 +100,10 @@ The :class:`XMLReader` interface supports the following methods: system identifier (a string identifying the input source -- typically a file name or an URL), a file-like object, or an :class:`InputSource` object. When :meth:`parse` returns, the input is completely processed, and the parser object - can be discarded or reset. As a limitation, the current implementation only - accepts byte streams; processing of character streams is for further study. + can be discarded or reset. + + .. versionchanged:: 3.5 + Added support of character streams. .. method:: XMLReader.getContentHandler() @@ -288,8 +290,7 @@ InputSource Objects .. method:: InputSource.setByteStream(bytefile) - Set the byte stream (a Python file-like object which does not perform - byte-to-character conversion) for this input source. + Set the byte stream (a :term:`binary file`) for this input source. The SAX parser will ignore this if there is also a character stream specified, but it will use a byte stream in preference to opening a URI connection itself. @@ -308,8 +309,7 @@ InputSource Objects .. method:: InputSource.setCharacterStream(charfile) - Set the character stream for this input source. (The stream must be a Python 1.6 - Unicode-wrapped file-like that performs conversion to strings.) + Set the character stream (a :term:`text file`) for this input source. If there is a character stream specified, the SAX parser will ignore any byte stream and will not attempt to open a URI connection to the system identifier. |