[XML-SIG] Re: elementtree crash

Fredrik Lundh fredrik at pythonware.com
Mon Sep 20 14:07:27 CEST 2004

"mf at mails" <mathias.foehr at mails.lu> wrote:
> elementtree (version of june 18th, 2004) crashes in a reproducable way
> in Python 2.3.4. Unfortunately, it crashes on both Windows and Linux
> with the same messages
> Sequence index out of range: list index out of range

works for me (on fedora, using a fresh build).

$ ./python
Python 2.3.4 (#1, Sep 20 2004, 12:46:02)
>>> from elementtree.ElementTree import Element, SubElement, dump
>>> elem = Element("window")
>>> dump(elem)
<window />
>>> from elementtree.ElementTree import VERSION

$ ./python elementtree-example-1.py
<window />

note that the error occurs in the regular expression compiler.  my guess is that
you've accidentally modified the ElementPath file in some strange way.  here's
what the offending pattern looks like on my machine:

xpath_tokenizer = re.compile(

does the elementtree selftest.py script work on your machine (you should get
a deprecation warning followed by "246 tests ok").


More information about the XML-SIG mailing list