[XML-SIG] PyXML 0.6.1 and Solaris
Albert Chin-A-Young
china@thewrittenword.com
Thu, 2 Nov 2000 10:38:59 -0600
Anyone have success using PyXML 0.6.1 and Solaris 2.6/SPARC? The problem
is the pyexpat module. The following code fails:
from xml.parsers import pyexpat
$ python
Python 2.0 (#1, Nov 1 2000, 13:16:57) [C] on sunos5
Type "copyright", "credits" or "license" for more information.
>>> from xml.parsers import pyexpat
>>> Traceback (most recent call last):
>>> File "<stdin>", line 1, in ?
>>> ImportError: cannot import name pyexpat
>>>
There are no problems on HP-UX, IRIX, or Compaq Tru64 UNIX. I did a
truss on the process from IRIX and saw that
_xmlplus/parsers/pyexpat.so was being loaded (I didn't compile Python
2.0 with the pyexpat module). However, a truss from the Solaris 2.6
host above (2.7 and 8 also give the same error) does not show that
pyexpat.so is trying to be loaded. The files it tries are:
_xmlplus/parsers/pyexpat
_xmlplus/parsers/pyexpat.py
_xmlplus/parsers/pyexpat.pyc
Turnes out that the autoconf script to select the correct dynload_*.c
file is broken for Solaris. Patch below (submitted to SourceForge too).
--
albert chin (china@thewrittenword.com)
-- snip snip
--- configure.in.orig Wed Nov 1 10:17:25 2000
+++ configure.in Thu Nov 2 10:22:55 2000
@@ -936,10 +939,9 @@
*)
# use dynload_shlib.c and dlopen() if we have it; otherwise stub
# out any dynamic loading
- if test "$ac_cv_func_dlopen" = yes
- then DYNLOADFILE="dynload_shlib.o"
- else DYNLOADFILE="dynload_stub.o"
- fi
+ AC_CHECK_FUNC(dlopen, DYNLOADFILE="dynload_shlib.o",
+ AC_CHECK_LIB(dl, dlopen, DYNLOADFILE="dynload_shlib.o",
+ DYNLOADFILE="dynload_stub.o"))
;;
esac
fi