This is the mail archive of the cygwin mailing list for the Cygwin project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[1.7] ctypes / geos / python / django


I asked a similar post on the python mailing list as i don't know where people
can help me on that subjet.

So, for my fellows readers, now that i have geos compiled and fully functionnal,
my next step is to validate the Django ctypes bindings, and we have there some
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 instdead
of libpython26.dll for example), i can compile and use a c or a c++ helloworld
library without problems and unittest for ctypes do not fail.


However, using it in my real world UseCase (django + geos), make me think that
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
======================================================================
ERROR: Testing WKT output.
----------------------------------------------------------------------
Traceback (most recent call last):
  File
"/cygdrive/e/minitage2/eggs/cache/Django-1.0.2_final_ZMinitagePatched_DjangoCchb-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_DjangoCchb-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_DjangoCchb-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 = self.__getitem__(name)

  File
"/minitage/dependencies/python-2.6/parts/part/lib/python2.6/ctypes/__init__.py",
line 371, in __getitem__
    func = self._FuncPtr((name_or_ordinal, self))
AttributeError: function 'free' not found (*ï)

For information, the Django/gis code can be read here [1] .

[1] -
http://code.djangoproject.com/browser/django/tags/releases/1.0.2/django/contrib/gis/tests/test_geos.py


Any thought on why ctypes can't find that 'free' function ?

-- 
Cordialement,
KiOrKY
GPG Key FingerPrint: 0x1A1194B7681112AF

Attachment: signature.asc
Description: OpenPGP digital signature


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]