[lxml-dev] python crashes in xmlDictFree inside Zope
Eric Tiffany
etiffany at alum.mit.edu
Mon Jun 4 17:48:57 CEST 2007
OK, after I added the DYLD_LIBRARY_PATH=/opt/local/lib to my environment for
starting zope from the Eclipse debugger, my code works with the Macports
2.6.28 libxml2. Thanks for that hint.
I'm a bit perplexed because, all along, lxml was reporting this information
in my logs:
lxml.etree: (1, 3, -1, 43887)
libxml used: (2, 6, 28)
libxml compiled: (2, 6, 28)
So evidently lxml thought it was using 2.6.28, while python was somehow
using the default Apple libxml2 libs. That happened whether I was running
inside Eclipse or from the normal zopectl startup, but in both of these
cases python would crash when I tried to create a XMLSchema. Strangely, it
worked properly when running without zope (and without any special env
settings).
Anyway, my libxml2 was compiled --with-threads. No clue if that is required
in my circumstances, but now that it works I'm not going to do any more
experiments for the time being.
ET
On 6/4/07 10:37 AM, "David Pratt" <fairwinds at eastlink.ca> wrote:
> Hi Gary. Many thanks for this. I'm definitely going to give this a try.
>
> Regards,
> David
>
> Gary Poster wrote:
>>
>> On Jun 4, 2007, at 9:39 AM, David Pratt wrote:
>>
>>> Hi Gary. I'd definitely be interested in more details about your
>>> buildout for these tools. I am also using buildouts and would much
>>> rather keep everything local to project. I am no longer using my
>>> system python for anything and relying on mac's tools seems lame since
>>> I want more control over versions being used, etc.
>>>
>>> Regards,
>>> David
>>
>> ok
>>
>> in [buildout], make sure "parts" includes "libxml2 libxslt lxml".
>>
>> I also include 'lxml' in my install_requires in my setup.py, but that
>> probably is redundant; haven't bothered to find out.
>>
>> I use these three sections:
>>
>> [lxml]
>> recipe = zc.recipe.egg:custom
>> egg = lxml == 1.3beta
>> include-dirs =
>> ${libxml2:location}/include/libxml2:${libxslt:location}/include
>> rpath = ${libxml2:location}/lib:${libxslt:location}/lib
>> library-dirs = ${libxml2:location}/lib:${libxslt:location}/lib
>>
>> [libxml2]
>> recipe = zc.recipe.cmmi
>> url = XXX our private download cache of libxml2-2.6.28.tar.gz XXX
>> extra_options = --without-python
>>
>> [libxslt]
>> recipe = zc.recipe.cmmi
>> url = XXX our private download cache of libxslt-1.1.20.tar.gz XXX
>> extra_options = --without-python --with-libxml-prefix=${libxml2:location}
>>
>> When I run bin/test and bin/py I need to insert the DYLD_LIBRARY_PATH in
>> the environment; I've planned to write a quick recipe for a shell script
>> that would do that, but have not gotten around to it. If you are using
>> zdaemon, you can leverage it to do that for zopectl start and zopectl
>> fg. Using one of the Zope 3 instance recipes I specify the environment:
>>
>> zdaemon.conf =
>> <environment>
>> DYLD_LIBRARY_PATH ${libxml2:location}/lib:${libxslt:location}/lib
>> LD_LIBRARY_PATH ${libxml2:location}/lib:${libxslt:location}/lib
>> </environment>
>>
>> (Mac only needs the DYLD one)
>>
>> Gary
>>
More information about the lxml-dev
mailing list