After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 167134 - Python bindings: registerErrorHandler broken?
Python bindings: registerErrorHandler broken?
Status: VERIFIED FIXED
Product: libxml2
Classification: Platform
Component: general
2.6.16
Other All
: Normal normal
: ---
Assigned To: Daniel Veillard
libxml QA maintainers
Depends on:
Blocks:
 
 
Reported: 2005-02-12 00:14 UTC by Frans Englich
Modified: 2009-08-15 18:40 UTC
See Also:
GNOME target: ---
GNOME version: ---



Description Frans Englich 2005-02-12 00:14:14 UTC
Please describe the problem:
  
It appears like registerErrorHandler or related doesn't work as documented on  
xmlsoft.org's validate.py example. The registered function appears to never be 
called. Example code and discussion can be found at:  
  
http://mail.gnome.org/archives/xml/2005-February/msg00001.html  
  
 
Cheers,  
Frans  
  

Steps to reproduce:
 

Actual results:


Expected results:


Does this happen every time?


Other information:
Comment 1 Daniel Veillard 2005-03-31 10:34:40 UTC
You misunderstood validity and well-formedness !
IsValid means there was a *validity* errror raised.
Your input is not well formed, a different, fatal kind of error.
Now w.r.t. the error message I don't get it on the current version:

paphio:~/XML -> cat tst.py
import libxml2

#deactivate error messages from the validation
def noerr(ctx, str):
        pass

libxml2.registerErrorHandler(noerr, None)

ctxt = libxml2.createFileParserCtxt("invalid.xml")
ctxt.validate(1)
ctxt.parseDocument()
doc = ctxt.doc()
valid = ctxt.isValid()
doc.freeDoc()
if valid != 0:
        print "validity check failed"

paphio:~/XML -> cat invalid.xml
<?xml version="1.0" ?>
<xml>
        <foo />
        <!--
        <thiasda
                asd
                asd

                ><>>>>>> tihs is invalid XML


                -->
</xml>

paphio:~/XML -> python tst.py
paphio:~/XML ->

  I assume this was fixed sometime ago,

Daniel
Comment 2 Daniel Veillard 2005-09-05 08:59:32 UTC
This should be closed by release of libxml2-2.6.21,

  thanks,

Daniel