title: Is there a way to recover iterparse on invalid Char values?
body: <p>I'm using lxml's <code>iterparse</code> to parse some big XML files (3-5Gig). Since some of these files have invalid characters a <code>lxml.etree.XMLSyntaxError</code> is thrown.</p>
  
  <p>When using lxml.etree.parse I can provide a parser which recovers on invalid characters:</p>
  
  <pre><code>parser = lxml.etree.XMLParser(recover=True)
  root = lxml.etree.parse(open("myMalformed.xml, parser)
  </code></pre>
  
  <p>Is there a way to get the same functionality for iterparse?</p>
  
  <p><strong>Edit:</strong>
  Encoding is not an Issue here. There are invalid characters in these XML files which can be sanitized by defining a XMLParser with recover=True. Since I need to use iterparse for this, I can't use a custom parser. So I'm looking for the functionality provided in my snippet above for this here:</p>
  
  <pre><code>context = etree.iterparse(open("myMalformed.xml", events=('end',), tag="Foo") &lt;-- cant recover
  </code></pre>