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 | |
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')
-rw-r--r-- | Doc/library/xml.sax.reader.rst | 12 | ||||
-rw-r--r-- | Doc/whatsnew/3.5.rst | 7 |
2 files changed, 13 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. diff --git a/Doc/whatsnew/3.5.rst b/Doc/whatsnew/3.5.rst index 4fea8af..e3381ae 100644 --- a/Doc/whatsnew/3.5.rst +++ b/Doc/whatsnew/3.5.rst @@ -499,6 +499,13 @@ xmlrpc * :class:`xmlrpc.client.ServerProxy` is now a :term:`context manager`. (Contributed by Claudiu Popa in :issue:`20627`.) +xml.sax +------- + +* SAX parsers now support a character stream of + :class:`~xml.sax.xmlreader.InputSource` object. + (Contributed by Serhiy Storchaka in :issue:`2175`.) + faulthandler ------------ |