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.

classification
Title: ElementPath parser in ElementTree 1.3 does not reject "element//" as invalid
Type: behavior Stage: resolved
Components: Library (Lib), XML Versions: Python 3.2, Python 2.7
process
Status: closed Resolution: wont fix
Dependencies: Superseder:
Assigned To: Nosy List: Arfrever, effbot, flox, scoder
Priority: normal Keywords:

Created on 2010-07-25 07:32 by scoder, last changed 2022-04-11 14:57 by admin. This issue is now closed.

Messages (3)
msg111521 - (view) Author: Stefan Behnel (scoder) * (Python committer) Date: 2010-07-25 07:32
Subject says it all:

Python 2.7 (r27:82500, Jul  5 2010, 13:37:06) 
[GCC 4.4.3] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> import xml.etree.ElementTree as ET
>>> el = ET.Element('hui')
>>> el.findall('section//')
[]
msg111522 - (view) Author: Stefan Behnel (scoder) * (Python committer) Date: 2010-07-25 07:43
The parser actually starts with this code:


def iterfind(elem, path, namespaces=None):
    # compile selector pattern
    if path[-1:] == "/":
        path = path + "*" # implicit all (FIXME: keep this?)


IMHO, the 'FIXME' is worth revisiting.
msg146592 - (view) Author: Florent Xicluna (flox) * (Python committer) Date: 2011-10-29 02:23
This behavior is verified with unit tests.
I don't plan to change it.
History
Date User Action Args
2022-04-11 14:57:04adminsetgithub: 53621
2011-11-08 01:27:54floxsetstatus: pending -> closed
2011-10-29 02:23:28floxsetstatus: open -> pending
resolution: wont fix
messages: + msg146592

stage: resolved
2010-07-25 15:04:35Arfreversetnosy: + Arfrever
2010-07-25 07:47:51scodersetnosy: + effbot, flox
2010-07-25 07:43:41scodersetmessages: + msg111522
2010-07-25 07:32:26scodersettype: behavior
2010-07-25 07:32:08scodercreate