<br><div class="gmail_quote">On Sat, Aug 27, 2011 at 1:21 PM, "Martin v. Löwis" <span dir="ltr"><<a href="mailto:martin@v.loewis.de">martin@v.loewis.de</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin: 0pt 0pt 0pt 0.8ex; border-left: 1px solid rgb(204, 204, 204); padding-left: 1ex;">
<div class="im">> I'd like to better understand why ctypes is (sometimes) frowned upon.<br>
><br>
> Is it the brittleness? Tendency to segfault?<br>
<br>
</div>That, and Python should work completely if ctypes is not available.<br><div class="im"></div></blockquote><div><br>What are the most major platforms ctypes doesn't work on?<br><br>It seems like there should be some way of coming up with an xml file describing the types of the various bits of data and formal arguments - perhaps using gccxml or something like it.<br>
<br></div><blockquote class="gmail_quote" style="margin: 0pt 0pt 0pt 0.8ex; border-left: 1px solid rgb(204, 204, 204); padding-left: 1ex;"><div class="im">
> FWIW, I have a partial implementation of a module that does xz from<br>
> Python using ctypes.<br>
<br>
</div>So does it work on Sparc/Solaris? On OpenBSD? On ARM-Linux? Does it<br>
work if the xz library is installed into /opt/sfw/xz?<font color="#888888"><br></font></blockquote><div><br>So far, I've only tried it on a couple of Linuxes and Cygwin. I intend to try it on a large number of *ix variants in the future, including OS/X and Haiku. I doubt I'll test OpenBSD, but I'm likely to test on FreeBSD and Dragonfly again.<br>
<br>With regard to /opt/sfw/xz, if ctypes.util.find_library(library) is smart enough to look there, then yes, xz_mod should find libxz there.<br><br>On Cygwin, ctypes.util.find_library() wasn't smart enough to find a Cygwin DLL, so I coded around that. But it finds the library OK on the Linuxes I've tried so far.<br>
<br>(This is part of a larger project, a backup program. The backup program has been tested on a large number of OS's, but I've not done another broad round of testing yet since adding the ctypes+xz code)<br><br>
<br> <br></div></div><br>