Opened 2 years ago

Closed 12 months ago

#20903 closed Bug (needsinfo)

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

Reported by: MRigal 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 Changed 23 months ago by claudep

  • Needs documentation unset
  • Needs tests unset
  • Patch needs improvement unset
  • Resolution set to worksforme
  • Status changed from new to closed

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 Changed 12 months ago by anonymous

  • Keywords geos postgres geodjango added
  • Resolution worksforme deleted
  • Status changed from closed to new
  • Type changed from Uncategorized to Bug
  • Version changed from 1.5 to 1.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 Changed 12 months ago by claudep

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

comment:4 Changed 12 months ago by claudep

  • Resolution set to needsinfo
  • Status changed from new to closed
Note: See TracTickets for help on using tickets.
Back to Top