Opened 11 years ago

Closed 10 years ago

#20903 closed Bug (needsinfo)

Again Exceptions in GEOS I/O object destructor at process exit

Reported by: Matthieu Rigal Owned by: nobody
Component: GIS Version: 1.6
Severity: Normal Keywords: geos, postgres, geodjango
Cc: Triage Stage: Unreviewed
Has patch: no Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: no UI/UX: no

Description

Very similarly to #13488 I saw these tracebacks in GeoDjango when I quit :

Exception TypeError: "'NoneType' object is not callable" in <bound method _WKBReader.__del__ of <django.contrib.gis.geos.prototypes.io._WKBReader object at 0x10704ea50>> ignored
Exception TypeError: "'NoneType' object is not callable" in <bound method WKBWriter.__del__ of <django.contrib.gis.geos.prototypes.io.WKBWriter object at 0x10705a290>> ignored

I experienced that on Python 2.7.4, Django 1.5.1 with Gdal 1.10, Geos 3.3.5, Postgres 9.2.4 and PostGIS 2.0.1 on MacOSX 10.8. And I do not have module-level globals.

The funny thing is that the warnings disappeared after some work, I tried to recreate the original conditions (prints, errors, etc..) but I do not manage to reproduce these errors I had 2 times in a row when quitting the runserver... In any case, seems very minor... Maybe some other may confirm the same behaviour.

Change History (4)

comment:1 by Claude Paroz, 11 years ago

Resolution: worksforme
Status: newclosed

I'm afraid it will be difficult to fix if we cannot come with a reproducible test case. If anyone can provide a failing test, please reopen the ticket.

comment:2 by anonymous, 10 years ago

Keywords: geos postgres geodjango added
Resolution: worksforme
Status: closednew
Type: UncategorizedBug
Version: 1.51.6

I'm receiving the same error with Python 2.7.7, Django 1.6.5, Geos 3.3.8, Postgres 9.3.1.0 (18) - using http://postgresapp.com/ and Mac OSX 10.8.5. It occurs every time I run a test, shell or a management command which accesses a database object which contains a gis_models.PointField

For example:

Python 2.7.7 (default, Jun  2 2014, 18:53:46) 
Type "copyright", "credits" or "license" for more information.

IPython 1.1.0 -- An enhanced Interactive Python.
?         -> Introduction and overview of IPython's features.
%quickref -> Quick reference.
help      -> Python's own help system.
object?   -> Details about 'object', use 'object??' for extra details.
/Users/matt/Code/envs/hpflsk3/lib/python2.7/site-packages/IPython/terminal/interactiveshell.py:432: DeprecationWarning: With-statements now directly support multiple context managers
  with nested(self.builtin_trap, self.display_trap):


In [1]: from myapp.models import Location

In [2]: l = Location()

In [3]: l.name = "blah"

In [4]: l.latitude = 1.23

In [5]: l.longitude = 4.56

In [6]: l.save()

In [7]: 
Do you really want to exit ([y]/n)? y
Exception TypeError: "'NoneType' object is not callable" in <bound method _WKTReader.__del__ of <django.contrib.gis.geos.prototypes.io._WKTReader object at 0x105565a50>> ignored
Exception TypeError: "'NoneType' object is not callable" in <bound method WKBWriter.__del__ of <django.contrib.gis.geos.prototypes.io.WKBWriter object at 0x1055af210>> ignored

Where models.py is

class Location(BaseModel):

    name = models.CharField(max_length=255)

    point = gis_models.PointField(default="POINT(0.0 0.0)")

    @property
    def latitude(self):
        return self.point.y

    @latitude.setter
    def latitude(self, value):
        self.point.y = value

    @property
    def longitude(self):
        return self.point.x

    @longitude.setter
    def longitude(self, value):
        self.point.x = value

comment:3 by Claude Paroz, 10 years ago

Could you maybe provide BaseModel also, or even better a complete sample project?

comment:4 by Claude Paroz, 10 years ago

Resolution: needsinfo
Status: newclosed
Note: See TracTickets for help on using tickets.
Back to Top