<div dir="ltr"><br><div>Hi, I&#39;m using Python 2.6.2 (Windows) and lxml 2.2.2.</div><div><br></div><div>When I run the following piece of code, it gets stuck.</div><div><br></div><div>import lxml.etree as et</div><div>s = &quot;&lt;root&gt;&lt;a&gt;&lt;b/&gt;&lt;c/&gt;&lt;/a&gt;&lt;d/&gt;&lt;e/&gt;&lt;/root&gt;&quot;</div>
<div>xml = et.fromstring(s)</div><div>print xml[0] # prints element a</div><div>print xml[2] # prints element e</div><div>print xml[3] # it should raise an out of range exception, but it gets stuck</div><div><br></div><div>
What is the problem? In the original ElementTree implementation, I get an IndexError.</div><div><br></div><div>Thanks,</div><div>Yassin</div><div><br></div></div>