[issue34941] xml.etree.ElementTree findall() fails when using custom TreeBuilder

2018-10-14 Thread Serhiy Storchaka


Change by Serhiy Storchaka :


--
resolution:  -> fixed
stage: patch review -> resolved
status: open -> closed
versions:  -Python 2.7

___
Python tracker 

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



[issue34941] xml.etree.ElementTree findall() fails when using custom TreeBuilder

2018-10-14 Thread Serhiy Storchaka


Serhiy Storchaka  added the comment:


New changeset 7c1c42b3209f1d2546daab6cd77f953eb255df6c by Serhiy Storchaka in 
branch '3.6':
[3.6] bpo-34941: Fix searching Element subclasses. (GH-9766) (GH-9868)
https://github.com/python/cpython/commit/7c1c42b3209f1d2546daab6cd77f953eb255df6c


--

___
Python tracker 

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



[issue34941] xml.etree.ElementTree findall() fails when using custom TreeBuilder

2018-10-14 Thread miss-islington


miss-islington  added the comment:


New changeset b1c800303e8458e00428ae66351ad492a503a46f by Miss Islington (bot) 
in branch '3.7':
bpo-34941: Fix searching Element subclasses. (GH-9766)
https://github.com/python/cpython/commit/b1c800303e8458e00428ae66351ad492a503a46f


--
nosy: +miss-islington

___
Python tracker 

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



[issue34941] xml.etree.ElementTree findall() fails when using custom TreeBuilder

2018-10-14 Thread Serhiy Storchaka


Change by Serhiy Storchaka :


--
pull_requests: +9236

___
Python tracker 

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



[issue34941] xml.etree.ElementTree findall() fails when using custom TreeBuilder

2018-10-14 Thread miss-islington


Change by miss-islington :


--
pull_requests: +9235

___
Python tracker 

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



[issue34941] xml.etree.ElementTree findall() fails when using custom TreeBuilder

2018-10-14 Thread Serhiy Storchaka


Serhiy Storchaka  added the comment:


New changeset b11c5667f99c4f0018e3394c4d07c519d835671a by Serhiy Storchaka in 
branch 'master':
bpo-34941: Fix searching Element subclasses. (GH-9766)
https://github.com/python/cpython/commit/b11c5667f99c4f0018e3394c4d07c519d835671a


--

___
Python tracker 

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



[issue34941] xml.etree.ElementTree findall() fails when using custom TreeBuilder

2018-10-09 Thread Serhiy Storchaka


Change by Serhiy Storchaka :


--
keywords: +patch
pull_requests: +9153
stage: needs patch -> patch review

___
Python tracker 

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



[issue34941] xml.etree.ElementTree findall() fails when using custom TreeBuilder

2018-10-09 Thread Serhiy Storchaka


Change by Serhiy Storchaka :


--
assignee:  -> serhiy.storchaka
components: +XML
nosy: +eli.bendersky, scoder, serhiy.storchaka
versions: +Python 2.7, Python 3.6, Python 3.8

___
Python tracker 

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



[issue34941] xml.etree.ElementTree findall() fails when using custom TreeBuilder

2018-10-09 Thread Jack Jansen


Jack Jansen  added the comment:

Correction to the last line:
When using Python 2.7 everything works fine. When adding a findall() method to 
the Element subclass that simply calls ElementPath.findall() everything also 
works fine. I suspect some issue with the _elementtree C implementation but I 
don't understand it.

--

___
Python tracker 

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



[issue34941] xml.etree.ElementTree findall() fails when using custom TreeBuilder

2018-10-09 Thread Jack Jansen


New submission from Jack Jansen :

When using a TreeBuilder with a custom factory (returning a subclass of Element 
with some extra functionality) there is an issue with findall().

XPaths using an indexed predicate no longer work: the findall() result is 
always empty. The attached test script shows the problem.

I have analysed this as far as finding that the issue is in 
ElementPath.prepare_predicate..select(), the last one. Specifically, 
the statement
elems = list(parent.findall(elem.tag))
always returns an empty list (if the Element class is subclassed).

When using Python 2.7 everything works fine. When adding a findall() method to 
the Element subclass that simply calls Element.findall() everything also works 
fine. I suspect some issue with the _elementtree C implementation but I don't 
understand it.

--
components: Library (Lib)
files: testetns.py
messages: 327385
nosy: jackjansen
priority: normal
severity: normal
stage: needs patch
status: open
title: xml.etree.ElementTree findall() fails when using custom TreeBuilder
type: behavior
versions: Python 3.7
Added file: https://bugs.python.org/file47859/testetns.py

___
Python tracker 

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