[lxml-dev] Segfault and bus error when importing lxml.html.clean after importing webbrowser
I was trying to use lxml.html.clean to sanitize comments in my blog. Unfortunately, although I can import and use it in a standalone console session, it fails within the webapp. Sometimes it segfaults, and sometimes it's a bus error instead. After going through all the imports to see what _they_ imported, I finally tracked down a minimal example that can cause the problem: import webbrowser import lxml.html.clean If I reverse the order of imports, everything works fine, so for the moment I've worked around it by making sure that lxml.html.clean is imported the very first thing. I have lxml compiled from the 2.0 tgz from the site, libxml2 2.6.31 and libxslt 1.1.22 installed via macports (both the latest versions macports has), Cython 0.9.6.11 installed, and I'm using Python 2.5.1 as downloaded from python.org for OS X. Here's the crash log Mac OS X provides: Process: Python [82702] Path: /Library/Frameworks/Python.framework/Versions/2.5/Resources/Python.app/Contents/MacOS/Python Identifier: Python Version: ??? (???) Code Type: X86 (Native) Parent Process: bash [188] Date/Time: 2008-02-02 00:05:49.472 -0600 OS Version: Mac OS X 10.5.1 (9B18) Report Version: 6 Exception Type: EXC_BAD_ACCESS (SIGBUS) Exception Codes: KERN_PROTECTION_FAILURE at 0x0000000000000005 Crashed Thread: 0 Thread 0 Crashed: 0 libxml2.2.dylib 0x91cda419 xmlDictLookup + 360 1 libxml2.2.dylib 0x00d78728 xmlXPathCompExprAdd + 280 2 libxml2.2.dylib 0x00d84e0c xmlXPathCompStep + 1004 3 libxml2.2.dylib 0x00d85812 xmlXPathCompRelativeLocationPath + 98 4 libxml2.2.dylib 0x00d86235 xmlXPathCompPathExpr + 1973 5 libxml2.2.dylib 0x00d86c35 xmlXPathCompUnaryExpr + 213 6 libxml2.2.dylib 0x00d86e3f xmlXPathCompMultiplicativeExpr + 15 7 libxml2.2.dylib 0x00d8702f xmlXPathCompAdditiveExpr + 15 8 libxml2.2.dylib 0x00d8717f xmlXPathCompRelationalExpr + 15 9 libxml2.2.dylib 0x00d8732f xmlXPathCompEqualityExpr + 15 10 libxml2.2.dylib 0x00d8748f xmlXPathCompAndExpr + 15 11 libxml2.2.dylib 0x00d87602 xmlXPathCompileExpr + 18 12 libxml2.2.dylib 0x00d868ec xmlXPathCompPathExpr + 3692 13 libxml2.2.dylib 0x00d86c35 xmlXPathCompUnaryExpr + 213 14 libxml2.2.dylib 0x00d86e3f xmlXPathCompMultiplicativeExpr + 15 15 libxml2.2.dylib 0x00d8702f xmlXPathCompAdditiveExpr + 15 16 libxml2.2.dylib 0x00d8717f xmlXPathCompRelationalExpr + 15 17 libxml2.2.dylib 0x00d8732f xmlXPathCompEqualityExpr + 15 18 libxml2.2.dylib 0x00d8748f xmlXPathCompAndExpr + 15 19 libxml2.2.dylib 0x00d87602 xmlXPathCompileExpr + 18 20 libxml2.2.dylib 0x00d87872 xmlXPathCompPredicate + 194 21 libxml2.2.dylib 0x00d84d4e xmlXPathCompStep + 814 22 libxml2.2.dylib 0x00d85812 xmlXPathCompRelativeLocationPath + 98 23 libxml2.2.dylib 0x00d86235 xmlXPathCompPathExpr + 1973 24 libxml2.2.dylib 0x00d86c35 xmlXPathCompUnaryExpr + 213 25 libxml2.2.dylib 0x00d86e3f xmlXPathCompMultiplicativeExpr + 15 26 libxml2.2.dylib 0x00d8702f xmlXPathCompAdditiveExpr + 15 27 libxml2.2.dylib 0x00d8717f xmlXPathCompRelationalExpr + 15 28 libxml2.2.dylib 0x00d8732f xmlXPathCompEqualityExpr + 15 29 libxml2.2.dylib 0x00d8748f xmlXPathCompAndExpr + 15 30 libxml2.2.dylib 0x00d87602 xmlXPathCompileExpr + 18 31 libxml2.2.dylib 0x00d8c6ca xmlXPathCtxtCompile + 90 32 etree.so 0x00bdc1d7 __pyx_pf_4lxml_5etree_5XPath___init__ + 551 (lxml.etree.c:79217) 33 org.python.python 0x00448981 type_call + 166 (typeobject.c:436) 34 org.python.python 0x003f9278 PyObject_Call + 45 (abstract.c:1860) 35 org.python.python 0x00480851 PyEval_EvalFrameEx + 9242 (ceval.c:3775) 36 org.python.python 0x00484cdc PyEval_EvalCodeEx + 1819 (ceval.c:2831) 37 org.python.python 0x00484e90 PyEval_EvalCode + 87 (ceval.c:500) 38 org.python.python 0x0049bcbe PyImport_ExecCodeModuleEx + 193 (import.c:669) 39 org.python.python 0x0049c114 load_source_module + 726 (import.c:953) 40 org.python.python 0x0049cd9b import_submodule + 293 (import.c:2394) 41 org.python.python 0x0049cfe9 load_next + 195 (import.c:2214) 42 org.python.python 0x0049d4dd import_module_level + 213 (import.c:2002) 43 org.python.python 0x0049d98d PyImport_ImportModuleLevel + 45 (import.c:2066) 44 org.python.python 0x00478917 builtin___import__ + 156 (bltinmodule.c:49) 45 org.python.python 0x003f9278 PyObject_Call + 45 (abstract.c:1860) 46 org.python.python 0x0047d5b2 PyEval_CallObjectWithKeywords + 112 (ceval.c:3433) 47 org.python.python 0x00481464 PyEval_EvalFrameEx + 12333 (ceval.c:2063) 48 org.python.python 0x00484cdc PyEval_EvalCodeEx + 1819 (ceval.c:2831) 49 org.python.python 0x00484e90 PyEval_EvalCode + 87 (ceval.c:500) 50 org.python.python 0x004a7cf2 PyRun_InteractiveOneFlags + 460 (pythonrun.c:1271) 51 org.python.python 0x004a7f2e PyRun_InteractiveLoopFlags + 85 (pythonrun.c:723) 52 org.python.python 0x004a86da PyRun_AnyFileExFlags + 155 (pythonrun.c:690) 53 org.python.python 0x004b5bb6 Py_Main + 3077 (main.c:523) 54 org.python.python 0x00001f8e 0x1000 + 3982 55 org.python.python 0x00001eb5 0x1000 + 3765 Thread 0 crashed with X86 Thread State (32-bit): eax: 0x009d0bd4 ebx: 0x91cda2c2 ecx: 0x00000004 edx: 0x0000e3d0 edi: 0x00000005 esi: 0x00000005 ebp: 0xbfffd428 esp: 0xbfffd3f0 ss: 0x0000001f efl: 0x00010202 eip: 0x91cda419 cs: 0x00000017 ds: 0x0000001f es: 0x0000001f fs: 0x00000000 gs: 0x00000037 cr2: 0x00000005 Binary Images: 0x1000 - 0x1fff +org.python.python 2.5a0 (2.5alpha0) /Library/Frameworks/Python.framework/Versions/2.5/Resources/Python.app/Contents/MacOS/Python 0xea000 - 0xebfff +cStringIO.so ??? (???) /Library/Frameworks/Python.framework/Versions/2.5/lib/python2.5/lib-dynload/cStringIO.so 0x3f0000 - 0x4e4fc3 +org.python.python 2.5a0 (2.5) /Library/Frameworks/Python.framework/Versions/2.5/Python 0x7f4000 - 0x7f5ffb +select.so ??? (???) /Library/Frameworks/Python.framework/Versions/2.5/lib/python2.5/lib-dynload/select.so 0x900000 - 0x926fdf +readline.so ??? (???) /Library/Frameworks/Python.framework/Versions/2.5/lib/python2.5/lib-dynload/readline.so 0x93e000 - 0x96ffe7 +libncurses.5.dylib ??? (???) /Library/Frameworks/Python.framework/Versions/2.5/lib/libncurses.5.dylib 0x98b000 - 0x98dfff +collections.so ??? (???) /Library/Frameworks/Python.framework/Versions/2.5/lib/python2.5/lib-dynload/collections.so 0x99a000 - 0x99bfff +fcntl.so ??? (???) /Library/Frameworks/Python.framework/Versions/2.5/lib/python2.5/lib-dynload/fcntl.so 0x9e3000 - 0x9e6ffb +_struct.so ??? (???) /Library/Frameworks/Python.framework/Versions/2.5/lib/python2.5/lib-dynload/_struct.so 0x9f4000 - 0x9f5ff3 +time.so ??? (???) /Library/Frameworks/Python.framework/Versions/2.5/lib/python2.5/lib-dynload/time.so 0xb00000 - 0xb02fff +binascii.so ??? (???) /Library/Frameworks/Python.framework/Versions/2.5/lib/python2.5/lib-dynload/binascii.so 0xb0d000 - 0xb0e073 +icglue.so ??? (???) /Library/Frameworks/Python.framework/Versions/2.5/lib/python2.5/lib-dynload/icglue.so 0xb1c000 - 0xb1ffff +strop.so ??? (???) /Library/Frameworks/Python.framework/Versions/2.5/lib/python2.5/lib-dynload/strop.so 0xb2c000 - 0xb2ffff +_Res.so ??? (???) /Library/Frameworks/Python.framework/Versions/2.5/lib/python2.5/lib-dynload/_Res.so 0xb3e000 - 0xb44fff +_File.so ??? (???) /Library/Frameworks/Python.framework/Versions/2.5/lib/python2.5/lib-dynload/_File.so 0xb63000 - 0xb64ffd +MacOS.so ??? (???) /Library/Frameworks/Python.framework/Versions/2.5/lib/python2.5/lib-dynload/MacOS.so 0xbb5000 - 0xc67ff9 +etree.so ??? (???) <9f2b581810d292f482356b73a83969f9> /Library/Frameworks/Python.framework/Versions/2.5/lib/python2.5/site-packages/lxml-2.0-py2.5-macosx-10.3-fat.egg/lxml/etree.so 0xcdd000 - 0xd09fff +libxslt.1.dylib ??? (???) /opt/local/lib/libxslt.1.dylib 0xd13000 - 0xd1ffff +libexslt.0.dylib ??? (???) /opt/local/lib/libexslt.0.dylib 0xd25000 - 0xe27fef +libxml2.2.dylib ??? (???) /opt/local/lib/libxml2.2.dylib 0xe59000 - 0xe69ffd +libz.1.dylib ??? (???) /opt/local/lib/libz.1.dylib 0xe6e000 - 0xf65ff0 +libiconv.2.dylib ??? (???) /opt/local/lib/libiconv.2.dylib 0xfd2000 - 0xfd4fff +operator.so ??? (???) /Library/Frameworks/Python.framework/Versions/2.5/lib/python2.5/lib-dynload/operator.so 0xfdf000 - 0xfe2fff +itertools.so ??? (???) /Library/Frameworks/Python.framework/Versions/2.5/lib/python2.5/lib-dynload/itertools.so 0x8fe00000 - 0x8fe2d883 dyld 95.3 (???) <81592e798780564b5d46b988f7ee1a6a> /usr/lib/dyld 0x9029d000 - 0x902f6fff libGLU.dylib ??? (???) /System/Library/Frameworks/OpenGL.framework/Versions/A/Libraries/libGLU.dylib 0x902f7000 - 0x906b5fea libLAPACK.dylib ??? (???) /System/Library/Frameworks/Accelerate.framework/Versions/A/Frameworks/vecLib.framework/Versions/A/libLAPACK.dylib 0x906b6000 - 0x907fbff7 com.apple.ImageIO.framework 2.0.0 (2.0.0) <154d4d8cda2bd99518cbabc9f2d69833> /System/Library/Frameworks/ApplicationServices.framework/Versions/A/Frameworks/ImageIO.framework/Versions/A/ImageIO 0x907fc000 - 0x9080affd libz.1.dylib ??? (???) <5ddd8539ae2ebfd8e7cc1c57525385c7> /usr/lib/libz.1.dylib 0x908b7000 - 0x908b7fff com.apple.Carbon 136 (136) <98a5e3bc0c4fa44bbb09713bb88707fe> /System/Library/Frameworks/Carbon.framework/Versions/A/Carbon 0x908c8000 - 0x908ccfff libGIF.dylib ??? (???) <d4234e6f5e5f530bdafb969157f1f17b> /System/Library/Frameworks/ApplicationServices.framework/Versions/A/Frameworks/ImageIO.framework/Versions/A/Resources/libGIF.dylib 0x908cd000 - 0x90b46fe7 com.apple.Foundation 6.5.1 (677.1) <85ac18c7cd454378db6122bea0c00965> /System/Library/Frameworks/Foundation.framework/Versions/C/Foundation 0x90b47000 - 0x90e20fe7 com.apple.CoreServices.CarbonCore 783 (783) <8370e664eeb25edc98d5c1f5405b06ae> /System/Library/Frameworks/CoreServices.framework/Versions/A/Frameworks/CarbonCore.framework/Versions/A/CarbonCore 0x90e21000 - 0x90e21ffd com.apple.Accelerate.vecLib 3.4 (vecLib 3.4) /System/Library/Frameworks/Accelerate.framework/Versions/A/Frameworks/vecLib.framework/Versions/A/vecLib 0x90fde000 - 0x9101dfef libTIFF.dylib ??? (???) <6d0f80e9d4d81f3f64c876aca005bd53> /System/Library/Frameworks/ApplicationServices.framework/Versions/A/Frameworks/ImageIO.framework/Versions/A/Resources/libTIFF.dylib 0x9101e000 - 0x910aaff7 com.apple.LaunchServices 286 (286) <72b15e7a01e42d510f0339e90113d5d6> /System/Library/Frameworks/CoreServices.framework/Versions/A/Frameworks/LaunchServices.framework/Versions/A/LaunchServices 0x910ab000 - 0x910caffa libJPEG.dylib ??? (???) <0cfb80109d624beb9ceb3c43b6c5ec10> /System/Library/Frameworks/ApplicationServices.framework/Versions/A/Frameworks/ImageIO.framework/Versions/A/Resources/libJPEG.dylib 0x910cb000 - 0x910e1fe7 com.apple.CoreVideo 1.5.0 (1.5.0) <7e010557527a0e6d49147c297d16850a> /System/Library/Frameworks/CoreVideo.framework/Versions/A/CoreVideo 0x910e2000 - 0x911c1fff libobjc.A.dylib ??? (???) <5eda47fec2d0e7853b3506aa1fd2dafa> /usr/lib/libobjc.A.dylib 0x911eb000 - 0x91345fe3 libSystem.B.dylib ??? (???) <8ecc83dc0399be3946f7a46e88cf4bbb> /usr/lib/libSystem.B.dylib 0x91346000 - 0x91350feb com.apple.audio.SoundManager 3.9.2 (3.9.2) <0f2ba6e891d3761212cf5a5e6134d683> /System/Library/Frameworks/Carbon.framework/Versions/A/Frameworks/CarbonSound.framework/Versions/A/CarbonSound 0x91c34000 - 0x91c3afff com.apple.print.framework.Print 218 (220) <c35172175abbe554ddadd9b6401351fa> /System/Library/Frameworks/Carbon.framework/Versions/A/Frameworks/Print.framework/Versions/A/Print 0x91c3b000 - 0x91c51fff com.apple.DictionaryServices 1.0.0 (1.0.0) <ad0aa0252e3323d182e17f50defe56fc> /System/Library/Frameworks/CoreServices.framework/Versions/A/Frameworks/DictionaryServices.framework/Versions/A/DictionaryServices 0x91c52000 - 0x91c6dffb libPng.dylib ??? (???) <b6abcac36ec7654ff3e1cfa786b0117b> /System/Library/Frameworks/ApplicationServices.framework/Versions/A/Frameworks/ImageIO.framework/Versions/A/Resources/libPng.dylib 0x91c78000 - 0x91c78ffb com.apple.installserver.framework 1.0 (8) /System/Library/PrivateFrameworks/InstallServer.framework/Versions/A/InstallServer 0x91cd8000 - 0x91db9ff7 libxml2.2.dylib ??? (???) <450ec38b57fb46013847cce851001a2f> /usr/lib/libxml2.2.dylib 0x91e5c000 - 0x91f0cfff edu.mit.Kerberos 6.0.11 (6.0.11) <33c25789baedcd70a7e24881775dd9ad> /System/Library/Frameworks/Kerberos.framework/Versions/A/Kerberos 0x92527000 - 0x92533ff5 libGL.dylib ??? (???) /System/Library/Frameworks/OpenGL.framework/Versions/A/Libraries/libGL.dylib 0x9253c000 - 0x925c6fff com.apple.framework.IOKit 1.5.1 (???) <5176a7383151a19c962334009fef2c6d> /System/Library/Frameworks/IOKit.framework/Versions/A/IOKit 0x9260a000 - 0x926b1fff com.apple.QD 3.11.50 (???) <e2f71720ae1dad06a8883ac80775b21a> /System/Library/Frameworks/ApplicationServices.framework/Versions/A/Frameworks/QD.framework/Versions/A/QD 0x926b2000 - 0x92768fe3 com.apple.CoreServices.OSServices 210.2 (210.2) <4ed69f07fc0f211ab32d1ee96e281fc2> /System/Library/Frameworks/CoreServices.framework/Versions/A/Frameworks/OSServices.framework/Versions/A/OSServices 0x92a21000 - 0x92a21ff8 com.apple.ApplicationServices 34 (34) <8f910fa65f01d401ad8d04cc933cf887> /System/Library/Frameworks/ApplicationServices.framework/Versions/A/ApplicationServices 0x939aa000 - 0x93a75fff com.apple.ColorSync 4.5.0 (4.5.0) /System/Library/Frameworks/ApplicationServices.framework/Versions/A/Frameworks/ColorSync.framework/Versions/A/ColorSync 0x93a7c000 - 0x93abefef com.apple.NavigationServices 3.5.1 (161) <cc6bd78eabf1e2e7166914e9f12f5850> /System/Library/Frameworks/Carbon.framework/Versions/A/Frameworks/NavigationServices.framework/Versions/A/NavigationServices 0x93c16000 - 0x93cc5fff com.apple.DesktopServices 1.4.3 (1.4.3) <66d5ed56111c43d234e235d365d02469> /System/Library/PrivateFrameworks/DesktopServicesPriv.framework/Versions/A/DesktopServicesPriv 0x93cc6000 - 0x93cf0fef libauto.dylib ??? (???) <d468bc4a8a69343f1748c293db1b57fb> /usr/lib/libauto.dylib 0x93d61000 - 0x94067fff com.apple.HIToolbox 1.5.0 (???) <1b872a7151ee3f80c9c736a3e46d00d9> /System/Library/Frameworks/Carbon.framework/Versions/A/Frameworks/HIToolbox.framework/Versions/A/HIToolbox 0x94080000 - 0x94147ff2 com.apple.vImage 3.0 (3.0) /System/Library/Frameworks/Accelerate.framework/Versions/A/Frameworks/vImage.framework/Versions/A/vImage 0x94196000 - 0x941a6ffc com.apple.LangAnalysis 1.6.4 (1.6.4) <cbeb17ab39f28351fe2ab5b82bf465bc> /System/Library/Frameworks/ApplicationServices.framework/Versions/A/Frameworks/LangAnalysis.framework/Versions/A/LangAnalysis 0x941a7000 - 0x94226ff5 com.apple.SearchKit 1.2.0 (1.2.0) <277b460da86bc222785159fe77e2e2ed> /System/Library/Frameworks/CoreServices.framework/Versions/A/Frameworks/SearchKit.framework/Versions/A/SearchKit 0x94227000 - 0x942d9ffb libcrypto.0.9.7.dylib ??? (???) <330b0e48e67faffc8c22dfc069ca7a47> /usr/lib/libcrypto.0.9.7.dylib 0x942da000 - 0x942daffa com.apple.CoreServices 32 (32) <2fcc8f3bd5bbfc000b476cad8e6a3dd2> /System/Library/Frameworks/CoreServices.framework/Versions/A/CoreServices 0x942db000 - 0x94352fe3 com.apple.CFNetwork 220 (221) <972a41911805859205b057a6f5b91e8d> /System/Library/Frameworks/CoreServices.framework/Versions/A/Frameworks/CFNetwork.framework/Versions/A/CFNetwork 0x943f2000 - 0x943f7fff com.apple.CommonPanels 1.2.4 (85) <ea0665f57cd267609466ed8b2b20e893> /System/Library/Frameworks/Carbon.framework/Versions/A/Frameworks/CommonPanels.framework/Versions/A/CommonPanels 0x943f8000 - 0x94427fe3 com.apple.AE 402 (402) <994ba8e884aefe7bf1fc5987df099e7b> /System/Library/Frameworks/CoreServices.framework/Versions/A/Frameworks/AE.framework/Versions/A/AE 0x94428000 - 0x944afff7 libsqlite3.0.dylib ??? (???) <273efcb717e89c21207c851d7d33fda4> /usr/lib/libsqlite3.0.dylib 0x944b0000 - 0x944ddfeb libvDSP.dylib ??? (???) <a26683d121ee0f96df9a9d0bfca36049> /System/Library/Frameworks/Accelerate.framework/Versions/A/Frameworks/vecLib.framework/Versions/A/libvDSP.dylib 0x944de000 - 0x944dfffc libffi.dylib ??? (???) <a3b573eb950ca583290f7b2b4c486d09> /usr/lib/libffi.dylib 0x9455e000 - 0x9456efff com.apple.speech.synthesis.framework 3.6.59 (3.6.59) <4ffef145fad3d4d787e0c33eab26b336> /System/Library/Frameworks/ApplicationServices.framework/Versions/A/Frameworks/SpeechSynthesis.framework/Versions/A/SpeechSynthesis 0x9456f000 - 0x9458dfff libresolv.9.dylib ??? (???) <54e6a08c2f108bdf5916fb483d51961b> /usr/lib/libresolv.9.dylib 0x945c8000 - 0x945dcff3 com.apple.ImageCapture 4.0 (5.0.0) /System/Library/Frameworks/Carbon.framework/Versions/A/Frameworks/ImageCapture.framework/Versions/A/ImageCapture 0x945dd000 - 0x949edfef libBLAS.dylib ??? (???) /System/Library/Frameworks/Accelerate.framework/Versions/A/Frameworks/vecLib.framework/Versions/A/libBLAS.dylib 0x949ee000 - 0x94a4aff7 com.apple.htmlrendering 68 (1.1.3) <fe87a9dede38db00e6c8949942c6bd4f> /System/Library/Frameworks/Carbon.framework/Versions/A/Frameworks/HTMLRendering.framework/Versions/A/HTMLRendering 0x94a51000 - 0x94f1dffe libGLProgrammability.dylib ??? (???) <e8bc0af671427cf2b6279a035805a086> /System/Library/Frameworks/OpenGL.framework/Versions/A/Libraries/libGLProgrammability.dylib 0x94f1f000 - 0x94f79ff7 com.apple.CoreText 2.0.0 (???) <7fa39cd5bc847615ec02e7c7a37c0508> /System/Library/Frameworks/ApplicationServices.framework/Versions/A/Frameworks/CoreText.framework/Versions/A/CoreText 0x94f7a000 - 0x95143fef com.apple.security 5.0.1 (32736) <8c9eda0fcc1d8a571543025ac900715f> /System/Library/Frameworks/Security.framework/Versions/A/Security 0x95156000 - 0x957edfef com.apple.CoreGraphics 1.351.0 (???) <7a6f399039eed6dbe845c169f7d21a70> /System/Library/Frameworks/ApplicationServices.framework/Versions/A/Frameworks/CoreGraphics.framework/Versions/A/CoreGraphics 0x957ee000 - 0x957fbfe7 com.apple.opengl 1.5.5 (1.5.5) <aa08b52d2a84b44dc6ee5d544a53fe8a> /System/Library/Frameworks/OpenGL.framework/Versions/A/OpenGL 0x95808000 - 0x95820fff com.apple.openscripting 1.2.6 (???) <b8e553df643f2aec68fa968b3b459b2b> /System/Library/Frameworks/Carbon.framework/Versions/A/Frameworks/OpenScripting.framework/Versions/A/OpenScripting 0x95835000 - 0x958b1feb com.apple.audio.CoreAudio 3.1.0 (3.1) <70bb7c657061631491029a61babe0b26> /System/Library/Frameworks/CoreAudio.framework/Versions/A/CoreAudio 0x958b2000 - 0x958b5fff com.apple.help 1.1 (36) <b507b08e484cb89033e9cf23062d77de> /System/Library/Frameworks/Carbon.framework/Versions/A/Frameworks/Help.framework/Versions/A/Help 0x95ab6000 - 0x95ab8ff5 libRadiance.dylib ??? (???) <20eadb285da83df96c795c2c5fa20590> /System/Library/Frameworks/ApplicationServices.framework/Versions/A/Frameworks/ImageIO.framework/Versions/A/Resources/libRadiance.dylib 0x95ab9000 - 0x95abbfff com.apple.securityhi 3.0 (30817) <2b2854123fed609d1820d2779e2e0963> /System/Library/Frameworks/Carbon.framework/Versions/A/Frameworks/SecurityHI.framework/Versions/A/SecurityHI 0x95b66000 - 0x95babfef com.apple.Metadata 10.5.0 (398) <4fd74fba0062c2e08ec4b1c10b40ff63> /System/Library/Frameworks/CoreServices.framework/Versions/A/Frameworks/Metadata.framework/Versions/A/Metadata 0x95bac000 - 0x95c3eff3 com.apple.ApplicationServices.ATS 3.0 (???) <fb5f572243dbc370a0ea5efc8e81ae11> /System/Library/Frameworks/ApplicationServices.framework/Versions/A/Frameworks/ATS.framework/Versions/A/ATS 0x95c3f000 - 0x95c9cffb libstdc++.6.dylib ??? (???) <04b812dcec670daa8b7d2852ab14be60> /usr/lib/libstdc++.6.dylib 0x95f3d000 - 0x95f8dff7 com.apple.HIServices 1.6.0 (???) <d74aa73e4cfd30a08fb169198a8d2539> /System/Library/Frameworks/ApplicationServices.framework/Versions/A/Frameworks/HIServices.framework/Versions/A/HIServices 0x96083000 - 0x96116fff com.apple.ink.framework 101.3 (86) <bf3fa8927b4b8baae92381a976fd2079> /System/Library/Frameworks/Carbon.framework/Versions/A/Frameworks/Ink.framework/Versions/A/Ink 0x9642d000 - 0x96463fff com.apple.SystemConfiguration 1.9.0 (1.9.0) <7919d9588c3b0d556646e555b7193f1f> /System/Library/Frameworks/SystemConfiguration.framework/Versions/A/SystemConfiguration 0x96483000 - 0x965bbff7 libicucore.A.dylib ??? (???) <afcea652ff2ec36885b2c81c57d06d4c> /usr/lib/libicucore.A.dylib 0x96782000 - 0x967fcff8 com.apple.print.framework.PrintCore 5.5 (245) <9441d178f4b430cf92b67bf346646693> /System/Library/Frameworks/ApplicationServices.framework/Versions/A/Frameworks/PrintCore.framework/Versions/A/PrintCore 0x96835000 - 0x9685cfff libcups.2.dylib ??? (???) <5521498e8902ddd0b15cfaa7db384e29> /usr/lib/libcups.2.dylib 0x9685d000 - 0x96897ff7 com.apple.coreui 0.1 (60) /System/Library/PrivateFrameworks/CoreUI.framework/Versions/A/CoreUI 0x96898000 - 0x9689ffe9 libgcc_s.1.dylib ??? (???) <f53c808e87d1184c0f9df63aef53ce0b> /usr/lib/libgcc_s.1.dylib 0x968a4000 - 0x968abffe libbsm.dylib ??? (???) <d25c63378a5029648ffd4b4669be31bf> /usr/lib/libbsm.dylib 0x968ea000 - 0x96c80ff7 com.apple.QuartzCore 1.5.1 (1.5.1) <deb61cbeb3f734a1b2f4669f6268b9de> /System/Library/Frameworks/QuartzCore.framework/Versions/A/QuartzCore 0x96c81000 - 0x96ca5fff libxslt.1.dylib ??? (???) <4933ddc7f6618743197aadc85b33b5ab> /usr/lib/libxslt.1.dylib 0x96ca6000 - 0x96caefff com.apple.DiskArbitration 2.2 (2.2) <1551b2af557fdf6f368f93e093933852> /System/Library/Frameworks/DiskArbitration.framework/Versions/A/DiskArbitration 0x96caf000 - 0x96cafffd com.apple.Accelerate 1.4 (Accelerate 1.4) /System/Library/Frameworks/Accelerate.framework/Versions/A/Accelerate 0x96cb0000 - 0x96d24fef libvMisc.dylib ??? (???) /System/Library/Frameworks/Accelerate.framework/Versions/A/Frameworks/vecLib.framework/Versions/A/libvMisc.dylib 0x96d68000 - 0x96da5ff7 libGLImage.dylib ??? (???) <202d73e6a4688fc06ff11b71910c2ce7> /System/Library/Frameworks/OpenGL.framework/Versions/A/Libraries/libGLImage.dylib 0x96dd6000 - 0x96dd7fef libmathCommon.A.dylib ??? (???) /usr/lib/system/libmathCommon.A.dylib 0x96dd8000 - 0x96f0afe7 com.apple.CoreFoundation 6.5 (476) <8bfebc0dbad6fc33bea0fa00a1b9ec37> /System/Library/Frameworks/CoreFoundation.framework/Versions/A/CoreFoundation 0x96f0b000 - 0x96f14fff com.apple.speech.recognition.framework 3.7.24 (3.7.24) <d3180f9edbd9a5e6f283d6156aa3c602> /System/Library/Frameworks/Carbon.framework/Versions/A/Frameworks/SpeechRecognition.framework/Versions/A/SpeechRecognition 0xfffe8000 - 0xfffebfff libobjc.A.dylib ??? (???) /usr/lib/libobjc.A.dylib 0xffff0000 - 0xffff1780 libSystem.B.dylib ??? (???) /usr/lib/libSystem.B.dylib
Hi, Jon Rosebaugh wrote:
Could you please try two things: - uninstall Cython (you do not need it to build from release sources) or make sure it is at least 0.9.6.11b (with a 'b'), not only 0.9.6.11, which has bugs - set DYLD_LIBRARY_PATH as explained here: http://codespeak.net/lxml/build.html#providing-newer-library-versions-on-mac... If that doesn't work, try building statically to make sure MacOS-X gets your libs right (which you definitely want for a production environment). Stefan
On Feb 2, 2008 12:34 AM, Stefan Behnel <stefan_ml@behnel.de> wrote:
These did not work.
If that doesn't work, try building statically to make sure MacOS-X gets your libs right (which you definitely want for a production environment).
My production deployment will actually be on Debian Linux; this is just my development machine. That said, I tried looking at the static build directions, but they're for Windows. I did download all the source archives for the various libraries, but I believe I have to configure them in a certain way for the static build? At any rate, the directories aren't the same as in the Windows example, and I'm not sure which directories are the right ones.
Hi, Jon Rosebaugh wrote:
No, normally they build everything you need for both static and dynamic linking. I have no idea how MacOS-X works here, but you should already have the libraries installed on your system, maybe you just need the development packages with header files and static build libs. But if you have the source directories, something like this might work: # cd /path/to/libxml2-src # ./configure CFLAGS="whatever you use" --without-python # make # cd /path/to/libxslt-src # ./configure CFLAGS="whatever you use" --without-python \ --with-libxml-src=/path/to/libxml2-src # make and then open lxml's setup.py and set the static include dirs to /path/to/libxml2-src/include /path/to/libxslt-src/libxslt /path/to/libxslt-src/libexslt + the normal system include dirs for zlib, iconv, etc. and the static lib dirs to /path/to/libxml2-src/.libs /path/to/libxslt-src/libxslt/.libs /path/to/libxslt-src/libexslt/.libs You may have to add something like "-liconv" and "-lz" to the static cflags to compile against the other libs, or maybe you need to link those statically also. Just try it out. The compiler calls from the standard build of lxml will give you hints what else you need. Hope that helps, Stefan
No luck. Apparently I need a universal build of libxml2 and libxslt in order for lxml to build, and I can't figure out how to compile those manually. I tried telling lxml to statically link against the universal builds provided by macports, but I got segfaulting again. On Sat, Feb 2, 2008 at 3:50 AM, Stefan Behnel <stefan_ml@behnel.de> wrote:
Stefan Behnel <stefan_ml@behnel.de> (SB) wrote:
SB> Hmm, too bad.
SB> Ok, calling for help here. Are there any other Mac users on the SB> list who could give hints?
I have the latest versions of libxml2 and libxslt installed with macports. Macports has a possibility to specify that it should install universal versions of the libraries but I haven't done that. When I compiled lxml 2.0 it did complain about something with ppc and intel architectures (I have an Intel machine), but the resulting library did work (it did run the tests). -- Piet van Oostrum <piet@cs.uu.nl> URL: http://pietvanoostrum.com [PGP 8DAE142BE17999C4] Private email: piet@vanoostrum.org
Hi Stefan and Jon, I've just intalled lxml-2.0 on OS X Tiger by using MacPorts and it worked without any problem. lxml-2.0 port is not yet available so I have to patch the portfile. I already sent the patch to MacPorts team so I hope that will be available soon. You can fetch the patch from below. http://trac.macosforge.org/projects/macports/ticket/14137 Thanks. On Feb 2, 2008 8:40 PM, Stefan Behnel <stefan_ml@behnel.de> wrote:
On Feb 2, 2008 7:26 AM, js <ebgssth@gmail.com> wrote:
I use the framework Python from python.org rather than the python available from macports, so it's my understanding that I can't use any macports python packages. Am I wrong?
Beats me. I've never used the framework Python. Not 100% sure but I *think* MacPorts python will work even if you installed the framework python, so If you don't have to stick to, give it a try. On Feb 2, 2008 10:41 PM, Jon Rosebaugh <chairos@gmail.com> wrote:
Sorry for the late reply. I've been using lxml 1.3.x for a while on MacOS, using the Python 2.4 installed by MacPorts (along with the libxml2 and libxslt). This configuration works well for me, but heed the DYLD_LIBRARY_PATH suggestion. You need to make sure this is set to the correct value for both building and (especially) runtime. If you build lxml using the DYLD set but don't have it set at runtime, lxml will report that it is using the correct versions of libraries, when it is actually not. I think I reported that on this list a while ago. I use lxml within a Zope/Plone installation, and also from within Eclipse. However, I have not used lxml 2.0 in this config, so YMMV. But, I would suggest getting everything from MacPorts (python, libxml, etc.). Also, note that it seems like the recent MacPorts builds only create python2.4 and python2.5 binaries -- it's up to you to either link "python" to one of these, or make sure your config settings explicitly call /usr/local/bin/python2.4 Good luck ET On 2/2/08 8:50 AM, "js" <ebgssth@gmail.com> wrote:
I'm beginning to think that it's not actually compiling statically. I set up a fresh install of OS X, installed Python, installed XCode, installed macports, libiconv, libxml2, zlib, libxslt, and tried building statically with the following options in the setup file and the following command: STATIC_INCLUDE_DIRS = ["/opt/local/include", "/opt/local/include/libxml2"] STATIC_LIBRARY_DIRS = ["/opt/local/lib"] STATIC_CFLAGS = ["-liconv", "-lz"] euterpe:~/lxml-2.0 jon$ export DYLD_LIBRARY_PATH=/opt/local/lib euterpe:~/lxml-2.0 jon$ python setup.py bdist_egg --static However, I noticed (a) that the gcc line still says -dynamic and (b) the file size of etree.so does not differ whether or not I build with the --static option. And I still get the same segfaults. Building lxml version 2.0. NOTE: Trying to build without Cython, pre-generated 'src/lxml/etree.c' needs to be available. running bdist_egg running egg_info writing src/lxml.egg-info/PKG-INFO writing top-level names to src/lxml.egg-info/top_level.txt writing dependency_links to src/lxml.egg-info/dependency_links.txt reading manifest file 'src/lxml.egg-info/SOURCES.txt' reading manifest template 'MANIFEST.in' warning: no previously-included files found matching 'doc/pyrex.txt' writing manifest file 'src/lxml.egg-info/SOURCES.txt' installing library code to build/bdist.macosx-10.3-fat/egg running install_lib running build_py creating build creating build/lib.macosx-10.3-fat-2.5 creating build/lib.macosx-10.3-fat-2.5/lxml copying src/lxml/__init__.py -> build/lib.macosx-10.3-fat-2.5/lxml copying src/lxml/_elementpath.py -> build/lib.macosx-10.3-fat-2.5/lxml copying src/lxml/builder.py -> build/lib.macosx-10.3-fat-2.5/lxml copying src/lxml/cssselect.py -> build/lib.macosx-10.3-fat-2.5/lxml copying src/lxml/doctestcompare.py -> build/lib.macosx-10.3-fat-2.5/lxml copying src/lxml/ElementInclude.py -> build/lib.macosx-10.3-fat-2.5/lxml copying src/lxml/htmlbuilder.py -> build/lib.macosx-10.3-fat-2.5/lxml copying src/lxml/sax.py -> build/lib.macosx-10.3-fat-2.5/lxml copying src/lxml/usedoctest.py -> build/lib.macosx-10.3-fat-2.5/lxml creating build/lib.macosx-10.3-fat-2.5/lxml/html copying src/lxml/html/__init__.py -> build/lib.macosx-10.3-fat-2.5/lxml/html copying src/lxml/html/_dictmixin.py -> build/lib.macosx-10.3-fat-2.5/lxml/html copying src/lxml/html/_diffcommand.py -> build/lib.macosx-10.3-fat-2.5/lxml/html copying src/lxml/html/builder.py -> build/lib.macosx-10.3-fat-2.5/lxml/html copying src/lxml/html/clean.py -> build/lib.macosx-10.3-fat-2.5/lxml/html copying src/lxml/html/defs.py -> build/lib.macosx-10.3-fat-2.5/lxml/html copying src/lxml/html/diff.py -> build/lib.macosx-10.3-fat-2.5/lxml/html copying src/lxml/html/ElementSoup.py -> build/lib.macosx-10.3-fat-2.5/lxml/html copying src/lxml/html/formfill.py -> build/lib.macosx-10.3-fat-2.5/lxml/html copying src/lxml/html/setmixin.py -> build/lib.macosx-10.3-fat-2.5/lxml/html copying src/lxml/html/usedoctest.py -> build/lib.macosx-10.3-fat-2.5/lxml/html running build_ext building 'lxml.etree' extension creating build/temp.macosx-10.3-fat-2.5 creating build/temp.macosx-10.3-fat-2.5/src creating build/temp.macosx-10.3-fat-2.5/src/lxml gcc -arch ppc -arch i386 -isysroot /Developer/SDKs/MacOSX10.4u.sdk -fno-strict-aliasing -Wno-long-double -no-cpp-precomp -mno-fused-madd -fno-common -dynamic -DNDEBUG -g -O3 -I/opt/local/include -I/opt/local/include/libxml2 -I/Library/Frameworks/Python.framework/Versions/2.5/include/python2.5 -c src/lxml/lxml.etree.c -o build/temp.macosx-10.3-fat-2.5/src/lxml/lxml.etree.o -w -liconv -lz i686-apple-darwin8-gcc-4.0.1: -liconv: linker input file unused because linking not done i686-apple-darwin8-gcc-4.0.1: -lz: linker input file unused because linking not done powerpc-apple-darwin8-gcc-4.0.1: -liconv: linker input file unused because linking not done powerpc-apple-darwin8-gcc-4.0.1: -lz: linker input file unused because linking not done gcc -arch i386 -arch ppc -isysroot /Developer/SDKs/MacOSX10.4u.sdk -g -bundle -undefined dynamic_lookup build/temp.macosx-10.3-fat-2.5/src/lxml/lxml.etree.o -L/opt/local/lib -lxslt -lexslt -lxml2 -lz -lm -o build/lib.macosx-10.3-fat-2.5/lxml/etree.so building 'lxml.objectify' extension gcc -arch ppc -arch i386 -isysroot /Developer/SDKs/MacOSX10.4u.sdk -fno-strict-aliasing -Wno-long-double -no-cpp-precomp -mno-fused-madd -fno-common -dynamic -DNDEBUG -g -O3 -I/opt/local/include -I/opt/local/include/libxml2 -I/Library/Frameworks/Python.framework/Versions/2.5/include/python2.5 -c src/lxml/lxml.objectify.c -o build/temp.macosx-10.3-fat-2.5/src/lxml/lxml.objectify.o -w -liconv -lz i686-apple-darwin8-gcc-4.0.1: -liconv: linker input file unused because linking not done i686-apple-darwin8-gcc-4.0.1: -lz: linker input file unused because linking not done powerpc-apple-darwin8-gcc-4.0.1: -liconv: linker input file unused because linking not done powerpc-apple-darwin8-gcc-4.0.1: -lz: linker input file unused because linking not done gcc -arch i386 -arch ppc -isysroot /Developer/SDKs/MacOSX10.4u.sdk -g -bundle -undefined dynamic_lookup build/temp.macosx-10.3-fat-2.5/src/lxml/lxml.objectify.o -L/opt/local/lib -lxslt -lexslt -lxml2 -lz -lm -o build/lib.macosx-10.3-fat-2.5/lxml/objectify.so building 'lxml.pyclasslookup' extension gcc -arch ppc -arch i386 -isysroot /Developer/SDKs/MacOSX10.4u.sdk -fno-strict-aliasing -Wno-long-double -no-cpp-precomp -mno-fused-madd -fno-common -dynamic -DNDEBUG -g -O3 -I/opt/local/include -I/opt/local/include/libxml2 -I/Library/Frameworks/Python.framework/Versions/2.5/include/python2.5 -c src/lxml/lxml.pyclasslookup.c -o build/temp.macosx-10.3-fat-2.5/src/lxml/lxml.pyclasslookup.o -w -liconv -lz i686-apple-darwin8-gcc-4.0.1: -liconv: linker input file unused because linking not done i686-apple-darwin8-gcc-4.0.1: -lz: linker input file unused because linking not done powerpc-apple-darwin8-gcc-4.0.1: -liconv: linker input file unused because linking not done powerpc-apple-darwin8-gcc-4.0.1: -lz: linker input file unused because linking not done gcc -arch i386 -arch ppc -isysroot /Developer/SDKs/MacOSX10.4u.sdk -g -bundle -undefined dynamic_lookup build/temp.macosx-10.3-fat-2.5/src/lxml/lxml.pyclasslookup.o -L/opt/local/lib -lxslt -lexslt -lxml2 -lz -lm -o build/lib.macosx-10.3-fat-2.5/lxml/pyclasslookup.so creating build/bdist.macosx-10.3-fat creating build/bdist.macosx-10.3-fat/egg creating build/bdist.macosx-10.3-fat/egg/lxml copying build/lib.macosx-10.3-fat-2.5/lxml/__init__.py -> build/bdist.macosx-10.3-fat/egg/lxml copying build/lib.macosx-10.3-fat-2.5/lxml/_elementpath.py -> build/bdist.macosx-10.3-fat/egg/lxml copying build/lib.macosx-10.3-fat-2.5/lxml/builder.py -> build/bdist.macosx-10.3-fat/egg/lxml copying build/lib.macosx-10.3-fat-2.5/lxml/cssselect.py -> build/bdist.macosx-10.3-fat/egg/lxml copying build/lib.macosx-10.3-fat-2.5/lxml/doctestcompare.py -> build/bdist.macosx-10.3-fat/egg/lxml copying build/lib.macosx-10.3-fat-2.5/lxml/ElementInclude.py -> build/bdist.macosx-10.3-fat/egg/lxml copying build/lib.macosx-10.3-fat-2.5/lxml/etree.so -> build/bdist.macosx-10.3-fat/egg/lxml creating build/bdist.macosx-10.3-fat/egg/lxml/html copying build/lib.macosx-10.3-fat-2.5/lxml/html/__init__.py -> build/bdist.macosx-10.3-fat/egg/lxml/html copying build/lib.macosx-10.3-fat-2.5/lxml/html/_dictmixin.py -> build/bdist.macosx-10.3-fat/egg/lxml/html copying build/lib.macosx-10.3-fat-2.5/lxml/html/_diffcommand.py -> build/bdist.macosx-10.3-fat/egg/lxml/html copying build/lib.macosx-10.3-fat-2.5/lxml/html/builder.py -> build/bdist.macosx-10.3-fat/egg/lxml/html copying build/lib.macosx-10.3-fat-2.5/lxml/html/clean.py -> build/bdist.macosx-10.3-fat/egg/lxml/html copying build/lib.macosx-10.3-fat-2.5/lxml/html/defs.py -> build/bdist.macosx-10.3-fat/egg/lxml/html copying build/lib.macosx-10.3-fat-2.5/lxml/html/diff.py -> build/bdist.macosx-10.3-fat/egg/lxml/html copying build/lib.macosx-10.3-fat-2.5/lxml/html/ElementSoup.py -> build/bdist.macosx-10.3-fat/egg/lxml/html copying build/lib.macosx-10.3-fat-2.5/lxml/html/formfill.py -> build/bdist.macosx-10.3-fat/egg/lxml/html copying build/lib.macosx-10.3-fat-2.5/lxml/html/setmixin.py -> build/bdist.macosx-10.3-fat/egg/lxml/html copying build/lib.macosx-10.3-fat-2.5/lxml/html/usedoctest.py -> build/bdist.macosx-10.3-fat/egg/lxml/html copying build/lib.macosx-10.3-fat-2.5/lxml/htmlbuilder.py -> build/bdist.macosx-10.3-fat/egg/lxml copying build/lib.macosx-10.3-fat-2.5/lxml/objectify.so -> build/bdist.macosx-10.3-fat/egg/lxml copying build/lib.macosx-10.3-fat-2.5/lxml/pyclasslookup.so -> build/bdist.macosx-10.3-fat/egg/lxml copying build/lib.macosx-10.3-fat-2.5/lxml/sax.py -> build/bdist.macosx-10.3-fat/egg/lxml copying build/lib.macosx-10.3-fat-2.5/lxml/usedoctest.py -> build/bdist.macosx-10.3-fat/egg/lxml byte-compiling build/bdist.macosx-10.3-fat/egg/lxml/__init__.py to __init__.pyc byte-compiling build/bdist.macosx-10.3-fat/egg/lxml/_elementpath.py to _elementpath.pyc byte-compiling build/bdist.macosx-10.3-fat/egg/lxml/builder.py to builder.pyc byte-compiling build/bdist.macosx-10.3-fat/egg/lxml/cssselect.py to cssselect.pyc byte-compiling build/bdist.macosx-10.3-fat/egg/lxml/doctestcompare.py to doctestcompare.pyc byte-compiling build/bdist.macosx-10.3-fat/egg/lxml/ElementInclude.py to ElementInclude.pyc byte-compiling build/bdist.macosx-10.3-fat/egg/lxml/html/__init__.py to __init__.pyc byte-compiling build/bdist.macosx-10.3-fat/egg/lxml/html/_dictmixin.py to _dictmixin.pyc byte-compiling build/bdist.macosx-10.3-fat/egg/lxml/html/_diffcommand.py to _diffcommand.pyc byte-compiling build/bdist.macosx-10.3-fat/egg/lxml/html/builder.py to builder.pyc byte-compiling build/bdist.macosx-10.3-fat/egg/lxml/html/clean.py to clean.pyc byte-compiling build/bdist.macosx-10.3-fat/egg/lxml/html/defs.py to defs.pyc byte-compiling build/bdist.macosx-10.3-fat/egg/lxml/html/diff.py to diff.pyc byte-compiling build/bdist.macosx-10.3-fat/egg/lxml/html/ElementSoup.py to ElementSoup.pyc byte-compiling build/bdist.macosx-10.3-fat/egg/lxml/html/formfill.py to formfill.pyc byte-compiling build/bdist.macosx-10.3-fat/egg/lxml/html/setmixin.py to setmixin.pyc byte-compiling build/bdist.macosx-10.3-fat/egg/lxml/html/usedoctest.py to usedoctest.pyc byte-compiling build/bdist.macosx-10.3-fat/egg/lxml/htmlbuilder.py to htmlbuilder.pyc byte-compiling build/bdist.macosx-10.3-fat/egg/lxml/sax.py to sax.pyc byte-compiling build/bdist.macosx-10.3-fat/egg/lxml/usedoctest.py to usedoctest.pyc creating stub loader for lxml/etree.so creating stub loader for lxml/objectify.so creating stub loader for lxml/pyclasslookup.so byte-compiling build/bdist.macosx-10.3-fat/egg/lxml/etree.py to etree.pyc byte-compiling build/bdist.macosx-10.3-fat/egg/lxml/objectify.py to objectify.pyc byte-compiling build/bdist.macosx-10.3-fat/egg/lxml/pyclasslookup.py to pyclasslookup.pyc creating build/bdist.macosx-10.3-fat/egg/EGG-INFO writing src/lxml.egg-info/native_libs.txt copying src/lxml.egg-info/PKG-INFO -> build/bdist.macosx-10.3-fat/egg/EGG-INFO copying src/lxml.egg-info/SOURCES.txt -> build/bdist.macosx-10.3-fat/egg/EGG-INFO copying src/lxml.egg-info/dependency_links.txt -> build/bdist.macosx-10.3-fat/egg/EGG-INFO copying src/lxml.egg-info/native_libs.txt -> build/bdist.macosx-10.3-fat/egg/EGG-INFO copying src/lxml.egg-info/not-zip-safe -> build/bdist.macosx-10.3-fat/egg/EGG-INFO copying src/lxml.egg-info/top_level.txt -> build/bdist.macosx-10.3-fat/egg/EGG-INFO creating dist creating 'dist/lxml-2.0-py2.5-macosx-10.3-fat.egg' and adding 'build/bdist.macosx-10.3-fat/egg' to it removing 'build/bdist.macosx-10.3-fat/egg' (and everything under it) euterpe:~/lxml-2.0 jon$ ls -lh dist/ total 3616 -rw-r--r-- 1 jon jon 1M Feb 2 13:03 lxml-2.0-py2.5-macosx-10.3-fat.egg
Hi, Jon Rosebaugh wrote:
Sorry for that, I just checked. "--static" will explicitly not work for other platforms than win32 (see the file setupinfo.py). I didn't write that code, so I wasn't aware how platform specific it is. Is there any chance you could figure out what you need to do for a static compile on MacOS? I.e., what binaries of the libs you need to include in the build, etc. If we can get them into setupinfo.py, I bet you wouldn't be the only happy Mac user. Otherwise, you'd have to stick with the normal build - but there's not much I can do myself to find out what's going wrong - I don't have a Mac (and when I see how difficult it seems to be to update a system library, I guess it won't become my favourite platform either...) Stefan
On Feb 2, 2008, at 12:40, Stefan Behnel wrote:
Here's a quick howto how I build dynamically linked lxml eggs under Macosx 10.4. Python is version 2.5 universal binary form python.org Via macports I installed libxml2 as an universal variant (+universal) and also the other needed libraries. I made sure that xml2-config from macports is found BEFORE the stock xml2-config in /usr/bin. Then I just called python setup.py bdist_egg to compile it. make test shows that 2.6.31 is used from macports but shows a bus error at the "test_inplace" test though. Apart from that I haven't noticed any problems. Kind regards, Michael
Hi, Michael Guntsche wrote:
Hmm, "test_inplace" doesn't tell me much, as it's just the make target for running all tests, not an individual test. However, it seems to be common for Mac users to have lxml crash, so we should definitely do something about it... Stefan
On Feb 4, 2008, at 8:09, Stefan Behnel wrote:
I upgraded Cython to 0.9.6.11 and recompiled lxml. Now make test, no longer segfaults but I get several errors in test_elementtree.py Examples: ERROR: test_feed_parser (lxml.tests.test_elementtree.ElementTreeTestCase) ---------------------------------------------------------------------- Traceback (most recent call last): File "/Library/Frameworks/Python.framework/Versions/2.5/lib/ python2.5/unittest.py", line 260, in run testMethod() File "/Users/maru/source/cvs+svn/lxml/src/lxml/tests/ test_elementtree.py", line 3011, in test_feed_parser parser = self.etree.XMLParser() AttributeError: 'module' object has no attribute 'XMLParser' ERROR: test_tostring_method_text (lxml.tests.test_elementtree.ElementTreeTestCase) ---------------------------------------------------------------------- Traceback (most recent call last): File "/Library/Frameworks/Python.framework/Versions/2.5/lib/ python2.5/unittest.py", line 260, in run testMethod() File "/Users/maru/source/cvs+svn/lxml/src/lxml/tests/ test_elementtree.py", line 2420, in test_tostring_method_text tostring(a, method="text")) TypeError: tostring() got an unexpected keyword argument 'method' Other than that everything seems to work normally, at least the features I use (validation and xpath most often). /mike
Hi, Michael Guntsche wrote:
Ah, that's good. You actually need Cython 0.9.6.11b(!) for a reliable install, but to keep these minor versions from biting people, I just updated the build page to make clear you'd better not install Cython for a normal release build, but to use the provided (and tested) C sources instead. http://codespeak.net/lxml/build.html#cython
That's just fine. The compatibility tests require ET 1.3 (currently only in SVN) to run. I'll just have to check why these tests aren't disabled for older (c)ET versions yet. Stefan
Hi, Jon Rosebaugh wrote:
The problem has been investigated. Apparently, importing the webbrowser module can dynamically load the libxml2 library. As only lxml was built against the updated libraries, this first import will load the older system libraries, which then conflict with the libraries that lxml requires. https://bugs.launchpad.net/lxml/+bug/197243 This problem is due to a misconfigured system that uses conflicting library versions, so there is nothing lxml can do here. Stefan
participants (6)
-
Eric Tiffany
-
Jon Rosebaugh
-
js
-
Michael Guntsche
-
Piet van Oostrum
-
Stefan Behnel