xslt error logs are gone since 2012

Bug #1551797 reported by Marcus Brinkmann
12
This bug affects 2 people
Affects Status Importance Assigned to Milestone
lxml
Fix Released
Medium
scoder

Bug Description

Hi,

I finally debugged a problem that locked us on lxml 2.3.5: xslt errors where spuriously absent from the error log in some situations. Turns out that revision 850144 "efactored error log connection into a context manager, added support for recursive usage of different logs" (Apr 7 14:51:20 2012) by Stefan Behnel broke this, because it only registers an xml error handler and not the one for xslt.

The attached patch fixes this, in addition to adding a test case for it.

Revision history for this message
Marcus Brinkmann (m-brinkmann) wrote :
Revision history for this message
scoder (scoder) wrote :
Changed in lxml:
importance: Undecided → Medium
status: New → Fix Committed
milestone: none → 3.6.1
Revision history for this message
Marcus Brinkmann (m-brinkmann) wrote : Re: [Bug 1551797] Re: xslt error logs are gone since 2012

Very cool, thanks a lot!

On 03/18/2016 08:19 PM, scoder wrote:
> I applied your patch and repaired it here:
>
> https://github.com/lxml/lxml/commit/079c1d452d0f0ae3826b73f59b6fd6a9b9d5dcf3
>
>
> ** Changed in: lxml
> Importance: Undecided => Medium
>
> ** Changed in: lxml
> Status: New => Fix Committed
>
> ** Changed in: lxml
> Milestone: None => 3.6.1
>

--
s<e>mantics GmbH
Viktoriaallee 45
52066 Aachen
Web: www.semantics.de
Registergericht : Amtsgericht Aachen, HRB 8189
Geschäftsführer : Kay Heiligenhaus M.A.
                   Dipl. Ing. José de la Rosa

Revision history for this message
Vojtěch Fried (vojtechfried) wrote :

Hi,
this fix actually broke lxml for me. We are using lxml in multiple threads. Unfortunately, unlike the libxml2 version (xmlSetGenericErrorFunc), the libxslt version (xsltSetGenericErrorFunc) is not thread safe, but is a global. So it cannot be safely used in multithreaded scenarios. Unless it is fixed in libxslt, the best thing to do in lxml is I think to make a build switch that would turn xsltSetGenericErrorFunc off.

Changed in lxml:
status: Fix Committed → New
Revision history for this message
scoder (scoder) wrote :

Since the previous fix breaks multi-threaded processing, I reverted it.

Changed in lxml:
milestone: 3.6.1 → none
status: New → Confirmed
Revision history for this message
scoder (scoder) wrote :

Here's a new fix (latest master branch) that hopefully solves both problems.
https://github.com/lxml/lxml/commit/d6fdeee94084e172bb81cf92119a081362f0dbcf

Changed in lxml:
assignee: nobody → scoder (scoder)
milestone: none → 4.2.0
status: Confirmed → Fix Committed
scoder (scoder)
Changed in lxml:
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.