X-Recipient: archive-cygwin AT delorie DOT com X-SWARE-Spam-Status: No, hits=-1.4 required=5.0 tests=AWL,BAYES_00,RCVD_IN_SORBS_DUL X-Spam-Check-By: sourceware.org Message-ID: <4B211856.6060103@cryptelium.net> Date: Thu, 10 Dec 2009 16:48:38 +0100 From: kiorky User-Agent: Thunderbird 2.0.0.23 (X11/20091122) MIME-Version: 1.0 To: cygwin AT cygwin DOT com Subject: [1.7] ctypes / geos / python / django OpenPGP: id=55851140; url=http://pgp.mit.edu:11371/pks/lookup?op=get&search=0x55851140 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="------------enigA83FAAF7D935F6E5150FD333" X-IsSubscribed: yes Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: cygwin-owner AT cygwin DOT com Mail-Followup-To: cygwin AT cygwin DOT com Delivered-To: mailing list cygwin AT cygwin DOT com --------------enigA83FAAF7D935F6E5150FD333 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable I asked a similar post on the python mailing list as i don't know where peo= ple can help me on that subjet. So, for my fellows readers, now that i have geos compiled and fully functio= nnal, my next step is to validate the Django ctypes bindings, and we have there s= ome tests to do that. Here come problems. With my python-2.6.4 hand made with some patches stolen from cygwin port (specially the ctypes one, and some arrangements (load cygpython26.Dll inst= dead of libpython26.dll for example), i can compile and use a c or a c++ hellowo= rld library without problems and unittest for ctypes do not fail. However, using it in my real world UseCase (django + geos), make me think t= hat there is a problem with ctypes. $ cat geos.py from django.contrib.gis.tests import test_geos test_geos.run() $ /minitage/dependencies/python-2.6/parts/part/bin/python bin/djangopy geos= .py Testing WKT output. ... ERROR Testing HEX output. ... ERROR Testing KML output. ... ERROR Testing the Error handlers. ... BEGIN - expecting GEOS_ERROR; safe to ignore. GEOS_ERROR: ParseException: Expected number but encountered ',' GEOS_ERROR: ParseException: Unknown WKB type 255 END - expecting GEOS_ERROR; safe to ignore. GEOS_ERROR: ParseException: Unexpected EOF parsing WKB ok Testing WKB output. ... ERROR Testing creation from HEX. ... ERROR Testing creation from WKB. ... ERROR Testing EWKT. ... ERROR Testing GeoJSON input/output (via GDAL). ... ok Testing equivalence. ... ERROR Testing Point objects. ... ERROR Testing MultiPoint objects. ... ERROR Testing LineString objects. ... ERROR Testing MultiLineString objects. ... ERROR Testing LinearRing objects. ... ERROR Testing Polygon objects. ... ERROR Testing MultiPolygon objects. ... BEGIN - expecting GEOS_NOTICE; safe to ignore. ERROR Testing Geometry __del__() on rings and polygons. ... ERROR Testing Coordinate Sequence objects. ... ok Testing relate() and relate_pattern(). ... ERROR Testing intersects() and intersection(). ... ok Testing union(). ... ok Testing difference(). ... ok Testing sym_difference(). ... ok Testing buffer(). ... ok Testing the SRID property and keyword. ... ERROR Testing the mutability of Polygons and Geometry Collections. ... ERROR Testing three-dimensional geometries. ... ok Testing the distance() function. ... ok Testing the length property. ... ok Testing empty geometries and collections. ... ERROR Testing `ogr` and `srs` properties. ... ok Testing use with the Python `copy` module. ... ok Testing `transform` method. ... ok Testing `extent` method. ... ok Testing pickling and unpickling support. ... ERROR =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D ERROR: Testing WKT output. ---------------------------------------------------------------------- Traceback (most recent call last): File "/cygdrive/e/minitage2/eggs/cache/Django-1.0.2_final_ZMinitagePatched_Djang= oCchb-py2.6.egg/django/contrib/gis/tests/test_geos.py", line 28, in test01a_wkt self.assertEqual(g.ewkt, geom.wkt) File "/cygdrive/e/minitage2/eggs/cache/Django-1.0.2_final_ZMinitagePatched_Djang= oCchb-py2.6.egg/django/contrib/gis/geos/base.py", line 378, in wkt return to_wkt(self.ptr) File "/cygdrive/e/minitage2/eggs/cache/Django-1.0.2_final_ZMinitagePatched_Djang= oCchb-py2.6.egg/django/contrib/gis/geos/prototypes/errcheck.py", line 67, in check_string libc.free(result) File "/minitage/dependencies/python-2.6/parts/part/lib/python2.6/ctypes/__init__= .py", line 366, in __getattr__ func =3D self.__getitem__(name) File "/minitage/dependencies/python-2.6/parts/part/lib/python2.6/ctypes/__init__= .py", line 371, in __getitem__ func =3D self._FuncPtr((name_or_ordinal, self)) AttributeError: function 'free' not found (*=EF=BF=BD) For information, the Django/gis code can be read here [1] . [1] - http://code.djangoproject.com/browser/django/tags/releases/1.0.2/django/con= trib/gis/tests/test_geos.py Any thought on why ctypes can't find that 'free' function ? --=20 Cordialement, KiOrKY GPG Key FingerPrint: 0x1A1194B7681112AF --------------enigA83FAAF7D935F6E5150FD333 Content-Type: application/pgp-signature; name="signature.asc" Content-Description: OpenPGP digital signature Content-Disposition: attachment; filename="signature.asc" -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.13 (GNU/Linux) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/ iEYEARECAAYFAkshGFoACgkQ6Hy4NVWFEUC6hwCdGyZm7maN/FPX56UK4SpYxH9O B5cAnjtP4IxY9vAKbpr6GehpqgqX43WP =EREh -----END PGP SIGNATURE----- --------------enigA83FAAF7D935F6E5150FD333--