https://github.com/python/cpython/commit/ad1bb6c14cb6d70bcf6411b84f9aaac07b28b416
commit: ad1bb6c14cb6d70bcf6411b84f9aaac07b28b416
branch: 3.14
author: Serhiy Storchaka <[email protected]>
committer: serhiy-storchaka <[email protected]>
date: 2026-05-26T09:34:51Z
summary:

[3.14] gh-150285: Fix too long docstrings in the pyexpat module (GH-150294) 
(GH-150463)

(cherry picked from commit 9da7923835a4c72e738551bbd78b8179a81286ad)

files:
M Modules/clinic/pyexpat.c.h
M Modules/pyexpat.c

diff --git a/Modules/clinic/pyexpat.c.h b/Modules/clinic/pyexpat.c.h
index e178547060446e..002d44c6c36c45 100644
--- a/Modules/clinic/pyexpat.c.h
+++ b/Modules/clinic/pyexpat.c.h
@@ -218,8 +218,9 @@ PyDoc_STRVAR(pyexpat_xmlparser_GetInputContext__doc__,
 "\n"
 "Return the untranslated text of the input that caused the current event.\n"
 "\n"
-"If the event was generated by a large amount of text (such as a start tag\n"
-"for an element with many attributes), not all of the text may be available.");
+"If the event was generated by a large amount of text (such as\n"
+"a start tag for an element with many attributes), not all of the\n"
+"text may be available.");
 
 #define PYEXPAT_XMLPARSER_GETINPUTCONTEXT_METHODDEF    \
     {"GetInputContext", (PyCFunction)pyexpat_xmlparser_GetInputContext, 
METH_NOARGS, pyexpat_xmlparser_GetInputContext__doc__},
@@ -357,9 +358,10 @@ PyDoc_STRVAR(pyexpat_xmlparser_UseForeignDTD__doc__,
 "\n"
 "Allows the application to provide an artificial external subset if one is not 
specified as part of the document instance.\n"
 "\n"
-"This readily allows the use of a \'default\' document type controlled by 
the\n"
-"application, while still getting the advantage of providing document type\n"
-"information to the parser. \'flag\' defaults to True if not provided.");
+"This readily allows the use of a \'default\' document type controlled\n"
+"by the application, while still getting the advantage of providing\n"
+"document type information to the parser.  \'flag\' defaults to True if\n"
+"not provided.");
 
 #define PYEXPAT_XMLPARSER_USEFOREIGNDTD_METHODDEF    \
     {"UseForeignDTD", _PyCFunction_CAST(pyexpat_xmlparser_UseForeignDTD), 
METH_METHOD|METH_FASTCALL|METH_KEYWORDS, 
pyexpat_xmlparser_UseForeignDTD__doc__},
@@ -417,7 +419,8 @@ 
PyDoc_STRVAR(pyexpat_xmlparser_SetAllocTrackerActivationThreshold__doc__,
 "\n"
 "Sets the number of allocated bytes of dynamic memory needed to activate 
protection against disproportionate use of RAM.\n"
 "\n"
-"By default, parser objects have an allocation activation threshold of 64 
MiB.");
+"By default, parser objects have an allocation activation threshold of\n"
+"64 MiB.");
 
 #define PYEXPAT_XMLPARSER_SETALLOCTRACKERACTIVATIONTHRESHOLD_METHODDEF    \
     {"SetAllocTrackerActivationThreshold", 
_PyCFunction_CAST(pyexpat_xmlparser_SetAllocTrackerActivationThreshold), 
METH_METHOD|METH_FASTCALL|METH_KEYWORDS, 
pyexpat_xmlparser_SetAllocTrackerActivationThreshold__doc__},
@@ -471,17 +474,18 @@ 
PyDoc_STRVAR(pyexpat_xmlparser_SetAllocTrackerMaximumAmplification__doc__,
 "\n"
 "Sets the maximum amplification factor between direct input and bytes of 
dynamic memory allocated.\n"
 "\n"
-"The amplification factor is calculated as \"allocated / direct\" while 
parsing,\n"
-"where \"direct\" is the number of bytes read from the primary document in 
parsing\n"
-"and \"allocated\" is the number of bytes of dynamic memory allocated in the 
parser\n"
-"hierarchy.\n"
+"The amplification factor is calculated as \"allocated / direct\" while\n"
+"parsing, where \"direct\" is the number of bytes read from the primary\n"
+"document in parsing and \"allocated\" is the number of bytes of\n"
+"dynamic memory allocated in the parser hierarchy.\n"
 "\n"
-"The \'max_factor\' value must be a non-NaN floating point value greater 
than\n"
-"or equal to 1.0. Amplification factors greater than 100.0 can be observed\n"
-"near the start of parsing even with benign files in practice. In 
particular,\n"
-"the activation threshold should be carefully chosen to avoid false 
positives.\n"
+"The \'max_factor\' value must be a non-NaN floating point value\n"
+"greater than or equal to 1.0.  Amplification factors greater than\n"
+"100.0 can be observed near the start of parsing even with benign\n"
+"files in practice.  In particular, the activation threshold should\n"
+"be carefully chosen to avoid false positives.\n"
 "\n"
-"By default, parser objects have a maximum amplification factor of 100.0.");
+"By default, parser objects have a maximum amplification factor of 100.");
 
 #define PYEXPAT_XMLPARSER_SETALLOCTRACKERMAXIMUMAMPLIFICATION_METHODDEF    \
     {"SetAllocTrackerMaximumAmplification", 
_PyCFunction_CAST(pyexpat_xmlparser_SetAllocTrackerMaximumAmplification), 
METH_METHOD|METH_FASTCALL|METH_KEYWORDS, 
pyexpat_xmlparser_SetAllocTrackerMaximumAmplification__doc__},
@@ -686,4 +690,4 @@ pyexpat_ErrorString(PyObject *module, PyObject *arg)
 #ifndef PYEXPAT_XMLPARSER_SETALLOCTRACKERMAXIMUMAMPLIFICATION_METHODDEF
     #define PYEXPAT_XMLPARSER_SETALLOCTRACKERMAXIMUMAMPLIFICATION_METHODDEF
 #endif /* 
!defined(PYEXPAT_XMLPARSER_SETALLOCTRACKERMAXIMUMAMPLIFICATION_METHODDEF) */
-/*[clinic end generated code: output=e73935658c04c83e input=a9049054013a1b77]*/
+/*[clinic end generated code: output=a389900b8335dcc4 input=a9049054013a1b77]*/
diff --git a/Modules/pyexpat.c b/Modules/pyexpat.c
index c9dc5e2211ecd5..ae39d891ad1115 100644
--- a/Modules/pyexpat.c
+++ b/Modules/pyexpat.c
@@ -1027,13 +1027,14 @@ pyexpat.xmlparser.GetInputContext
 
 Return the untranslated text of the input that caused the current event.
 
-If the event was generated by a large amount of text (such as a start tag
-for an element with many attributes), not all of the text may be available.
+If the event was generated by a large amount of text (such as
+a start tag for an element with many attributes), not all of the
+text may be available.
 [clinic start generated code]*/
 
 static PyObject *
 pyexpat_xmlparser_GetInputContext_impl(xmlparseobject *self)
-/*[clinic end generated code: output=a88026d683fc22cc input=034df8712db68379]*/
+/*[clinic end generated code: output=a88026d683fc22cc input=3ff7cb00783c8f98]*/
 {
     if (self->in_callback) {
         int offset, size;
@@ -1165,15 +1166,16 @@ pyexpat.xmlparser.UseForeignDTD
 
 Allows the application to provide an artificial external subset if one is not 
specified as part of the document instance.
 
-This readily allows the use of a 'default' document type controlled by the
-application, while still getting the advantage of providing document type
-information to the parser. 'flag' defaults to True if not provided.
+This readily allows the use of a 'default' document type controlled
+by the application, while still getting the advantage of providing
+document type information to the parser.  'flag' defaults to True if
+not provided.
 [clinic start generated code]*/
 
 static PyObject *
 pyexpat_xmlparser_UseForeignDTD_impl(xmlparseobject *self, PyTypeObject *cls,
                                      int flag)
-/*[clinic end generated code: output=d7d98252bd25a20f input=23440ecb0573fb29]*/
+/*[clinic end generated code: output=d7d98252bd25a20f input=0387bce44fd53d99]*/
 {
     pyexpat_state *state = PyType_GetModuleState(cls);
     enum XML_Error rc;
@@ -1240,14 +1242,15 @@ pyexpat.xmlparser.SetAllocTrackerActivationThreshold
 
 Sets the number of allocated bytes of dynamic memory needed to activate 
protection against disproportionate use of RAM.
 
-By default, parser objects have an allocation activation threshold of 64 MiB.
+By default, parser objects have an allocation activation threshold of
+64 MiB.
 [clinic start generated code]*/
 
 static PyObject *
 pyexpat_xmlparser_SetAllocTrackerActivationThreshold_impl(xmlparseobject *self,
                                                           PyTypeObject *cls,
                                                           unsigned long long 
threshold)
-/*[clinic end generated code: output=bed7e93207ba08c5 input=9c706b75c18e4ea1]*/
+/*[clinic end generated code: output=bed7e93207ba08c5 input=a96541ba5ea46747]*/
 {
     return set_activation_threshold(
         self, cls, threshold,
@@ -1266,24 +1269,25 @@ pyexpat.xmlparser.SetAllocTrackerMaximumAmplification
 
 Sets the maximum amplification factor between direct input and bytes of 
dynamic memory allocated.
 
-The amplification factor is calculated as "allocated / direct" while parsing,
-where "direct" is the number of bytes read from the primary document in parsing
-and "allocated" is the number of bytes of dynamic memory allocated in the 
parser
-hierarchy.
+The amplification factor is calculated as "allocated / direct" while
+parsing, where "direct" is the number of bytes read from the primary
+document in parsing and "allocated" is the number of bytes of
+dynamic memory allocated in the parser hierarchy.
 
-The 'max_factor' value must be a non-NaN floating point value greater than
-or equal to 1.0. Amplification factors greater than 100.0 can be observed
-near the start of parsing even with benign files in practice. In particular,
-the activation threshold should be carefully chosen to avoid false positives.
+The 'max_factor' value must be a non-NaN floating point value
+greater than or equal to 1.0.  Amplification factors greater than
+100.0 can be observed near the start of parsing even with benign
+files in practice.  In particular, the activation threshold should
+be carefully chosen to avoid false positives.
 
-By default, parser objects have a maximum amplification factor of 100.0.
+By default, parser objects have a maximum amplification factor of 100.
 [clinic start generated code]*/
 
 static PyObject *
 pyexpat_xmlparser_SetAllocTrackerMaximumAmplification_impl(xmlparseobject 
*self,
                                                            PyTypeObject *cls,
                                                            float max_factor)
-/*[clinic end generated code: output=6e44bd48c9b112a0 input=918b9266b490a722]*/
+/*[clinic end generated code: output=6e44bd48c9b112a0 input=9cd13e3ea845dbb4]*/
 {
     return set_maximum_amplification(
         self, cls, max_factor,

_______________________________________________
Python-checkins mailing list -- [email protected]
To unsubscribe send an email to [email protected]
https://mail.python.org/mailman3//lists/python-checkins.python.org
Member address: [email protected]

Reply via email to