diff options
author | Stanley <46876382+slateny@users.noreply.github.com> | 2024-02-23 18:57:08 (GMT) |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-02-23 18:57:08 (GMT) |
commit | 462a2fc09d9e5f7cdd3a8f2faed73e5bc2c93349 (patch) | |
tree | a40ef6e6d8cefd57fc4d4a63006881fd9dd35f23 /Doc/library/pyexpat.rst | |
parent | 3d8fc06d4f8dc1e7be2455a7e89b37285fa89112 (diff) | |
download | cpython-462a2fc09d9e5f7cdd3a8f2faed73e5bc2c93349.zip cpython-462a2fc09d9e5f7cdd3a8f2faed73e5bc2c93349.tar.gz cpython-462a2fc09d9e5f7cdd3a8f2faed73e5bc2c93349.tar.bz2 |
gh-54358: Clarify data chunking in pyexpat (GH-31629)
Co-authored-by: Éric Araujo <merwok@netwok.org>
Diffstat (limited to 'Doc/library/pyexpat.rst')
-rw-r--r-- | Doc/library/pyexpat.rst | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/Doc/library/pyexpat.rst b/Doc/library/pyexpat.rst index 935e872..a6ae8fd 100644 --- a/Doc/library/pyexpat.rst +++ b/Doc/library/pyexpat.rst @@ -214,7 +214,8 @@ XMLParser Objects :meth:`CharacterDataHandler` callback whenever possible. This can improve performance substantially since Expat normally breaks character data into chunks at every line ending. This attribute is false by default, and may be changed at - any time. + any time. Note that when it is false, data that does not contain newlines + may be chunked too. .. attribute:: xmlparser.buffer_used @@ -372,7 +373,10 @@ otherwise stated. marked content, and ignorable whitespace. Applications which must distinguish these cases can use the :attr:`StartCdataSectionHandler`, :attr:`EndCdataSectionHandler`, and :attr:`ElementDeclHandler` callbacks to - collect the required information. + collect the required information. Note that the character data may be + chunked even if it is short and so you may receive more than one call to + :meth:`CharacterDataHandler`. Set the :attr:`buffer_text` instance attribute + to ``True`` to avoid that. .. method:: xmlparser.UnparsedEntityDeclHandler(entityName, base, systemId, publicId, notationName) |