[issue38611] ElementTree.ParseError does not implement SyntaxError interface as expected

2019-10-29 Thread Karthikeyan Singaravelan


Change by Karthikeyan Singaravelan :


--
nosy: +scoder

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue38611] ElementTree.ParseError does not implement SyntaxError interface as expected

2019-10-29 Thread Jim Carroll


Jim Carroll  added the comment:

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);
 }

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue38611] ElementTree.ParseError does not implement SyntaxError interface as expected

2019-10-28 Thread Brett Cannon


Change by Brett Cannon :


--
title: Bug in traceback.py -> ElementTree.ParseError does not implement 
SyntaxError interface as expected

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com