[xml] python bindings and error handlers


I'm debugging the "error.py" test that fails with my windows build
of the python bindings (the error callback is never called).

It seems that the error is due to the MERGED_MODULES compile option.

In that situation, initlibxml2mod calls
libxml_xmlErrorInitialize which in turn calls 
xmlSetGenericErrorFunc(NULL, libxml_xmlErrorFuncHandler).

Then the same initlibxml2mod calls initlibxsltmod,
which calls libxslt_xsltErrorInitialize which in turn calls 
xsltSetGenericErrorFunc(NULL, libxslt_xsltErrorFuncHandler)
but also xmlSetGenericErrorFunc(NULL, libxslt_xsltErrorFuncHandler),
thus replacing the xml error handler by the xslt one,
and thus disabling libxml2.registerErrorHandler.

I've verified that calling libxslt.registerErrorHandler
is enough to catch both xml and xslt errors. That works
but it's a bit disturbing that libxml2.registerErrorHandler
has no effect at all.

I believe this behaviour is not windows specific.


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]