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 valeriy.nov
Recipients valeriy.nov
Date 2013-12-02.15:18:45
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <>
Consider repeated executions of a code like this:
>tree = xml.etree.ElementTree.parse( full_name ) # many different files
>report_type = tree.getroot().attrib['Name'] # something changing
>tree.getroot().find( ".//t:Detail", {'t' : report_type} )

There is a _cache variable in \Lib\xml\etree\
>def iterfind(elem, path, namespaces=None):
>    // ...
>    try:
>        selector = _cache[path]
>    except KeyError:
>    // ...

In my code I use the same path (".//t:Detail"), so no KeyError exception is raised and cached (the same) value is used, but full path should be different ('.//{url_one}Detail', './/{url_two}Detail', etc) depending on namespaces dictionary.
Date User Action Args
2013-12-02 15:18:46valeriy.novsetrecipients: + valeriy.nov
2013-12-02 15:18:46valeriy.novsetmessageid: <>
2013-12-02 15:18:46valeriy.novlinkissue19862 messages
2013-12-02 15:18:45valeriy.novcreate