[lxml-dev] [BUG] lxml-2* hangs on interpreter shutdown with gtk-mainloop

Stefan Behnel stefan_ml at behnel.de
Mon Mar 17 17:20:42 CET 2008


Hi,

René 'Necoro' Neumann wrote:
>> I attached a patch that also works for me and (again) seems to work
>> around the symptom you see.
> 
> This patch only works for me when passing a filename or file to parse().
> When passing a StringIO instance it still hangs.

True, didn't realise that in my tests.

Here is another patch that seems to work better for me (still no idea why).


> What about the way simpler patch:
> Add the following lines somewhere, where they fit:
> 
> if base_url is None:
>     base_url = ""
> 
> Because passing an empty base_url works too. Or does this have
> side-effects?

Yes. The URL is used to identify the document in a couple of places, and the
base_url parameter is just a way to override the URL in cases where lxml can't
determine it itself.

Stefan
-------------- next part --------------
A non-text attachment was scrubbed...
Name: gtk-threading-filename-guessing.patch
Type: text/x-patch
Size: 1054 bytes
Desc: not available
Url : http://codespeak.net/pipermail/lxml-dev/attachments/20080317/4bf371f5/attachment.bin 


More information about the lxml-dev mailing list