From fa114305cbf030818e1b056a7752d6bddb2e7c70 Mon Sep 17 00:00:00 2001 From: Justin Bronn Date: Wed, 31 Mar 2010 18:58:19 +0000 Subject: [PATCH] [1.1.X] No longer use the deprecated GEOS C API function `GEOSGeomFromWKB_buf` when unpickling `GEOSGeometry` objects. Backport of r12898 from trunk. git-svn-id: http://code.djangoproject.com/svn/django/branches/releases/1.1.X@12899 bcc190cf-cafb-0310-a4f2-bffc1f526a37 --- django/contrib/gis/geos/geometry.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/django/contrib/gis/geos/geometry.py b/django/contrib/gis/geos/geometry.py index 866a852d49..c1e3c66dde 100644 --- a/django/contrib/gis/geos/geometry.py +++ b/django/contrib/gis/geos/geometry.py @@ -142,7 +142,7 @@ class GEOSGeometry(GEOSBase, ListMixin): def __setstate__(self, state): # Instantiating from the tuple state that was pickled. wkb, srid = state - ptr = capi.from_wkb(wkb, len(wkb)) + ptr = wkb_r.read(buffer(wkb)) if not ptr: raise GEOSException('Invalid Geometry loaded from pickled state.') self.ptr = ptr self._post_init(srid)