Hi,<div><br></div><div>I was planning on upgrading to a recent version of lxml but found that our code was failing in numerous places with None objects found in unexpected places. </div><div>In lxml 2+ the findtext method will ignore the default and return None if the element is found but the text is empty.</div>
<div>In elementtree and lxml before 2 the findtext method would never return None, if the element is found but empty it would return the default.</div><div><br></div><div>Unfortunately I am unable to tell which exact version of lxml introduced that change. And I am not sure if this change is by design, but I would say it is not.</div>
<div><br></div><div>A proposed fix (if it is a bug...) is included in the attached unified diff.</div><div><br></div><div>Cheers,</div><div><br></div><div>Aloys<br>-- <br>Aloys Baillet<br>Research & Development - Animal Logic<br>
--<br>
</div>