RE: [xml] python bindings on windows



  hum, strange ... I may have to look at it. 
Is that just on Windows ?

Don't know... I'll see if I can reproduce it with cygwin.
 
Next, we need to change libxsl.py to bypass
the 'dl' magic on windows. I'd suggest inserting
something like this: 

if not hasattr(sys,'getdlopenflags'):
    import libxml2mod
    import libxsltmod
    import libxml2
else: 
    ...

at the beginning of the file.

 Could you explain a bit,

libxslt.py tries to do some magic 
manipulating the dlopen flags.
There are all kinds of fallback mechanisms,
but even those fail on windows:

Python 2.2.2 (#37, Oct 14 2002, 17:02:34) [MSC 32 bit (Intel)] on win32
Type "help", "copyright", "credits" or "license" for more information.
import libxslt
Traceback (most recent call last):
  File "<stdin>", line 1, in ?
  File "libxslt.py", line 30, in ?
    print "libxslt could not guess RTLD_GLOBAL and RTLD_NOW " + \
NameError: name 'osname' is not defined

That's because os.uname() does not exist...

In any case printing the message about RTLD_...
stuff would not make any sense on windows. 
So I suggest bypassing the whole stuff 
if 'sys.getdlopenflags' is not available,
hence the test I propose.
Alternatively, you could test 
sys.platform.startswith('win').
Attached is my local copy of libxsl.py.

-sbi

Attachment: libxsl.py
Description: Text document



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]