New submission from Justin <justin.a.bl...@gmail.com>:

When the following text it loaded in to an ElementTree Element, the find method 
is unable to find one of the elements without a namespace assigned to it.
```
import xml.etree.ElementTree as ElementTree

xml_text = """
<ns0:Envelope 
xmlns:ns0="http://schemas.xmlsoap.org/soap/envelope/";><ns0:Body><ns0:Fault><faultcode>a:ActionNotSupported</faultcode><faultstring
 xml:lang="en-US">The message with Action \'\' cannot be processed at the 
receiver, due to a ContractFilter mismatch at the EndpointDispatcher. This may 
be because of either a contract mismatch (mismatched Actions between sender and 
receiver) or a binding/security mismatch between the sender and the receiver.  
Check that sender and receiver have the same contract and the same binding 
(including security requirements, e.g. Message, Transport, 
None).</faultstring></ns0:Fault></ns0:Body></ns0:Envelope>
"""

xml = ElementTree.fromstring(xml_text)
ele = xml.find('faultstring')
ele == None #True
```

----------
components: XML
messages: 332106
nosy: spacether
priority: normal
severity: normal
status: open
title: xml.etree.ElementTree Elment.find bug, fails to find tag
type: enhancement
versions: Python 3.7

_______________________________________
Python tracker <rep...@bugs.python.org>
<https://bugs.python.org/issue35531>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to