Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit 462a2fc

Browse filesBrowse files
slatenymerwok
andauthored
gh-54358: Clarify data chunking in pyexpat (GH-31629)
Co-authored-by: Éric Araujo <merwok@netwok.org>
1 parent 3d8fc06 commit 462a2fc
Copy full SHA for 462a2fc

File tree

Expand file treeCollapse file tree

1 file changed

+6
-2
lines changed
Filter options
Expand file treeCollapse file tree

1 file changed

+6
-2
lines changed

‎Doc/library/pyexpat.rst

Copy file name to clipboardExpand all lines: Doc/library/pyexpat.rst
+6-2Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -214,7 +214,8 @@ XMLParser Objects
214214
:meth:`CharacterDataHandler` callback whenever possible. This can improve
215215
performance substantially since Expat normally breaks character data into chunks
216216
at every line ending. This attribute is false by default, and may be changed at
217-
any time.
217+
any time. Note that when it is false, data that does not contain newlines
218+
may be chunked too.
218219

219220

220221
.. attribute:: xmlparser.buffer_used
@@ -372,7 +373,10 @@ otherwise stated.
372373
marked content, and ignorable whitespace. Applications which must distinguish
373374
these cases can use the :attr:`StartCdataSectionHandler`,
374375
:attr:`EndCdataSectionHandler`, and :attr:`ElementDeclHandler` callbacks to
375-
collect the required information.
376+
collect the required information. Note that the character data may be
377+
chunked even if it is short and so you may receive more than one call to
378+
:meth:`CharacterDataHandler`. Set the :attr:`buffer_text` instance attribute
379+
to ``True`` to avoid that.
376380

377381

378382
.. method:: xmlparser.UnparsedEntityDeclHandler(entityName, base, systemId, publicId, notationName)

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.