<br><div class="gmail_quote">On Sat, Aug 27, 2011 at 1:21 PM, &quot;Martin v. Löwis&quot; <span dir="ltr">&lt;<a href="mailto:martin@v.loewis.de">martin@v.loewis.de</a>&gt;</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">&gt; I&#39;d like to better understand why ctypes is (sometimes) frowned upon.<br>
&gt;<br>
&gt; 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&#39;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">
&gt; FWIW, I have a partial implementation of a module that does xz from<br>
&gt; 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&#39;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&#39;ll test OpenBSD, but I&#39;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&#39;t smart enough to find a Cygwin DLL, so I coded around that.  But it finds the library OK on the Linuxes I&#39;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&#39;s, but I&#39;ve not done another broad round of testing yet since adding the ctypes+xz code)<br><br>
<br> <br></div></div><br>