[Lxml-checkins] r52952 - in lxml/trunk: . src/lxml

scoder at codespeak.net scoder at codespeak.net
Wed Mar 26 00:18:14 CET 2008


Author: scoder
Date: Wed Mar 26 00:18:13 2008
New Revision: 52952

Modified:
   lxml/trunk/   (props changed)
   lxml/trunk/src/lxml/parser.pxi
Log:
 r3829 at delle:  sbehnel | 2008-03-26 00:12:53 +0100
 stop early on feed parser errors


Modified: lxml/trunk/src/lxml/parser.pxi
==============================================================================
--- lxml/trunk/src/lxml/parser.pxi	(original)
+++ lxml/trunk/src/lxml/parser.pxi	Wed Mar 26 00:18:13 2008
@@ -503,7 +503,7 @@
                 not context._validator.isvalid():
             well_formed = 0 # actually not 'valid', but anyway ...
         elif recover or (c_ctxt.wellFormed and \
-                       c_ctxt.lastError.level < xmlerror.XML_ERR_ERROR):
+                             c_ctxt.lastError.level < xmlerror.XML_ERR_ERROR):
             well_formed = 1
         elif not c_ctxt.replaceEntities and not c_ctxt.validate \
                  and context is not None:
@@ -946,7 +946,8 @@
             py_buffer_len = py_buffer_len - buffer_len
             c_data = c_data + buffer_len
 
-        if error:
+        if error or (not pctxt.wellFormed and
+                     not self._parse_options & xmlparser.XML_PARSE_RECOVER):
             self._feed_parser_running = 0
             try:
                 context._handleParseResult(self, NULL, None)


More information about the lxml-checkins mailing list