1 Aug 08:47
Re: Segfault on XSLT/XPath undefined variable error.
Stefan Behnel <stefan_ml <at> behnel.de>
2008-08-01 06:47:07 GMT
2008-08-01 06:47:07 GMT
Hi, John Krukoff wrote: > Okay, can only get it to crash when first signing a document using > libxmlsec, so I suppose I'll simply assume that the two libraries use > the error log in incompatible ways. could you check if this patch makes it work better for you? It basically restricts XSLT error logging to the lifetime of an XSL transformation. Stefan
=== src/lxml/xmlerror.pxi
==================================================================
--- src/lxml/xmlerror.pxi (revision 4715)
+++ src/lxml/xmlerror.pxi (local)
@@ -25,11 +25,10 @@
# divert error messages to the global error log
xmlerror.xmlThrDefSetStructuredErrorFunc(NULL, _receiveError)
- connectErrorLog(NULL)
+ xmlerror.xmlSetStructuredErrorFunc(NULL, _receiveError)
cdef void connectErrorLog(void* log):
xmlerror.xmlSetStructuredErrorFunc(log, _receiveError)
- xslt.xsltSetGenericErrorFunc(log, _receiveXSLTError)
(Continue reading)
Looking at the code, it seems that changing function _utf8 in
apihelpers.pxi to accept UTF-8 encoded bytestrings (see patch below) would
be sufficient to make lxml accept UTF-8 encoded bytestrings. Indeed, that
seems to work.
1. Will what I'm doing subtly break lxml in some way if I make use of this
patched lxml in my own code?
2. Should lxml be changed in this way? If it's considered important to
avoid accidentally passing non-ASCII bytestrings to lxml, would it be
acceptable to add a global switch to enable accepting UTF-8 encoded
bytestrings?
RSS Feed