[virt-tools-list] [libosinfo PATCH] Fix libxml error reporting

Daniel Veillard veillard at redhat.com
Wed Nov 30 09:11:04 UTC 2011


On Fri, Nov 25, 2011 at 04:30:29PM +0100, Christophe Fergeau wrote:
> Hey,
> 
> On Fri, Nov 25, 2011 at 03:14:42PM +0100, Guido Günther wrote:
> > On Fri, Nov 25, 2011 at 01:34:02PM +0100, Christophe Fergeau wrote:
> > > On Fri, Nov 25, 2011 at 09:30:27AM +0100, Guido Günther wrote:
> > > > On Fri, Nov 18, 2011 at 11:03:41PM +0100, Guido Günther wrote:
> > > > > The error code might be set in catchXMLError so make sure we don't miss
> > > > > it. Otherwise this results in errors like:
> > > > > 
> > > > > /usr/lib/python2.7/dist-packages/gi/types.py:43: Warning: GError set over the top of a previous GError or uninitialized memory.
> > > > > This indicates a bug in someone's code. You must ensure an error is NULL before it's set.
> > > > > The overwriting error message was: Incorrect root element
> > > > 
> > > > Can this be appplied?
> > > 
> > > Relooking at this, I'm a bit surprised that it's possible to have
> > > catchXMLError be called and to get a non NULL xml document returned. How
> > > are you triggering this condition ?
> > 
> > By running demo.py from the topleveldir of the source tree (instead of
> > from inside examples/):
> 
> Ah ok, thanks. It seems parsing errors are being reported but that they are
> non-fatal. Which means it might be better to just clear the GError when a
> parsed document is returned by xmlCtxtReadDoc:

  Right, ther is 2 level of XML parsing error, fatal ones, where
the parser must top returning further informations about the document
being parsed, and non-fatal ones, which must be reported but parsing
can proceed.
  If you get a document back from libxml2, that mean you didn't hit any
fatal error, and the output can probably be consumed.

Daniel

-- 
Daniel Veillard      | libxml Gnome XML XSLT toolkit  http://xmlsoft.org/
daniel at veillard.com  | Rpmfind RPM search engine http://rpmfind.net/
http://veillard.com/ | virtualization library  http://libvirt.org/




More information about the virt-tools-list mailing list