This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author jamercee
Recipients jamercee
Date 2019-10-29.22:46:43
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1572389203.57.0.35979259068.issue38611@roundup.psfhosted.org>
In-reply-to
Content
This patch solves the issue

diff --git a/Modules/_elementtree.c b/Modules/_elementtree.c
index c3f30c9339..d265021f75 100644
--- a/Modules/_elementtree.c
+++ b/Modules/_elementtree.c
@@ -2782,6 +2782,7 @@ treebuilder_handle_start(TreeBuilderObject* self, PyObject* tag,
                 st->parseerror_obj,
                 "multiple elements on top level"
                 );
+                       PyErr_SyntaxLocationEx("xml.etree.ElementTree", 0, 0);
             goto error;
         }
         Py_INCREF(node);
@@ -3267,6 +3268,7 @@ expat_set_error(enum XML_Error error_code, Py_ssize_t line, Py_ssize_t column,
     Py_DECREF(position);

     PyErr_SetObject(st->parseerror_obj, error);
+       PyErr_SyntaxLocationEx("xml.etree.ElementTree", (int)line, (int)column);
     Py_DECREF(error);
 }
History
Date User Action Args
2019-10-29 22:46:43jamerceesetrecipients: + jamercee
2019-10-29 22:46:43jamerceesetmessageid: <1572389203.57.0.35979259068.issue38611@roundup.psfhosted.org>
2019-10-29 22:46:43jamerceelinkissue38611 messages
2019-10-29 22:46:43jamerceecreate