[lxml-dev] XSLT and threading

eric casteleijn eric at infrae.com
Wed Jul 23 09:59:47 CEST 2008


> I investigated this a little more. The way lxml now handles passing trees
> between threads is that it migrates all tag names from the dictionary of the
> thread that created the tree to the dictionary of the target thread.
> 
> It seems that there is more that has to be done here. Your test specifically
> crashes when trying to free the "xml" special name (or maybe "xmlns", not
> sure). Breakpointing on xmlDictLookup() showed me that libxml2 also stores
> (some?) namespace URIs and prefixes in the dictionary, at least during
> parsing. It doesn't do this when declaring namespaces later on with
> xmlNewNs(). How's that for consistency...

Ugh. This would explain why the tests (often) didn't break when I took 
out the custom namespaces. (But they did sometimes...)

> So the fix is even a bit more involved than I initially thought. It may take a
> bit to figure out how to get this straight.

Ok, well I'm just very glad we (for very 'you' values of 'we') are 
getting closer, since hunting for it by myself nearly drove me to drink. 
;) Let me know if there is anything I can do to help, like test, since 
my C skills are probably not going to be much use without a lot of 
dusting off.

-- 
- eric casteleijn
http://infrae.com
-------------- next part --------------
A non-text attachment was scrubbed...
Name: eric.vcf
Type: text/x-vcard
Size: 289 bytes
Desc: not available
Url : http://codespeak.net/pipermail/lxml-dev/attachments/20080723/c1262892/attachment.vcf 


More information about the lxml-dev mailing list