Potential Bug in django.contrib.gis

39 views
Skip to first unread message

Janis Goldzycher

unread,
Sep 3, 2020, 11:16:50 AM9/3/20
to Django users

Hi all,
I recently upgraded django 1.11 to 3.1. Now, in dango 3.1, the following example code from https://docs.djangoproject.com/en/3.1/ref/contrib/gis/geos/#django.contrib.gis.geos.Polygon
produces a Segfault.

Code snippet:
>>> from django.contrib.gis.geos import Point, LineString, Polygon, LinearRing
>>> ext_coords = ((0, 0), (0, 1), (1, 1), (1, 0), (0, 0))
>>> int_coords = ((0.4, 0.4), (0.4, 0.6), (0.6, 0.6), (0.6, 0.4), (0.4, 0.4))
>>> poly = Polygon(ext_coords, int_coords)
>>> [c for c in poly]
[<LinearRing object at 0x7f4796e4f9a0>, <LinearRing object at 0x7f4796e4f2b8>]
>>> [c for c in poly[0]]
Segmentation fault (core dumped)

I can also provoke this error with next():
>>> from django.contrib.gis.geos import Point, LineString, Polygon, LinearRing
>>> ext_coords = ((0, 0), (0, 1), (1, 1), (1, 0), (0, 0))
>>> int_coords = ((0.4, 0.4), (0.4, 0.6), (0.6, 0.6), (0.6, 0.4), (0.4, 0.4))
>>> poly = Polygon(ext_coords, int_coords)
>>> next(poly[0].__iter__())
Segmentation fault (core dumped)

Is this a bug or might there be another reason (e.g. hardware-related issue)?

Thanks,
Janis

Janis

unread,
Sep 3, 2020, 11:29:42 AM9/3/20
to Django users
Additional Info: I get this behavious in python 3.6.7, which according to the documentation should be compatible with django 3.1.
Reply all
Reply to author
Forward
0 new messages