[New-bugs-announce] [issue19452] ElementTree iterparse documentation

Peter Harris report at bugs.python.org
Wed Oct 30 14:57:26 CET 2013

New submission from Peter Harris:

Documentation on python website says:

    xml.etree.ElementTree.iterparse(source, events=None, parser=None)
Parses an XML section into an element tree incrementally, and reports what’s going on to the user. source is a filename or file object containing XML data. events is a list of events to report back.

But 'events' must be a *tuple* or iterparse raises "TypeError: invalid event tuple"

Possibly also worth explaining that "start-ns" event is accompanied by a tuple of (namespace, url) rather than an element from the XML document. Currently the description just says "ns events are used to get detailed namespace information" but doesn't say how or give an example.

assignee: docs at python
components: Documentation
messages: 201734
nosy: Peter.Harris, docs at python
priority: normal
severity: normal
status: open
title: ElementTree iterparse documentation
versions: Python 3.3

Python tracker <report at bugs.python.org>

More information about the New-bugs-announce mailing list