GNOME Bugzilla – Bug 630682
Selftest failure (serialize.py)
Last modified: 2012-05-11 04:41:01 UTC
I successfully built the libxml2-2.7.7 (note, 2.7.7 not listed in bugzilla "Version" pulldown) core library on OS X 10.6 (32-bit arch), it passed all self-tests with the exception of ebcdic (known deficiency in my libiconv). When I enable building of python bindings, they also build fine, but their self-test fails: -- OK error.py -- FAILED serialize.py error serializing HTML document 4 -- OK validate.py I'm using fink's python, and get same results with both python2.6 and python2.7. Googling finds a single report of this bug, on linux-fron-scratch mailing list: http://www.mail-archive.com/blfs-dev@linuxfromscratch.org/msg10068.html finding it first broke in 2.7.4 I tried with python2.5 just for kicks, but then *every* self-test fails with: Fatal Python error: Interpreter not initialized (version mismatch?) I retried the latest available in fink (libxml2-2.6.32) and the self-tests there are clean for all three python versions.
Created attachment 177458 [details] [review] Sync serialize.py self-test expected results with libxml results There appear to be three differences between the expected and actual serialize results. Two of them are solely capitalization differences in the name of a charset in a <meta ...> tag (expecting "charset=iso-8859-1" vs libxml2 returning "charset=ISO-8859-1"). The third is libxml2 returning a <meta ...> tag for the HTML document whereas the test is not expecting that tag at all. Attached patch (given to me by Daniel Johnson) gets it to pass for python25 26 and 27.
Slightly more complex than that, the charset changes are right, but htmlSetMetaEncoding() was broken, so I fixed it but also apply 2 chunks from your patch. Now "make check" looks okay again :-) http://git.gnome.org/browse/libxml2/commit/?id=39d027cdb74371d64f68dc488556be41e1d14546 thanks for the patch ! Daniel