Opened 16 years ago

Last modified 13 years ago

#7873 closed

GEOSGeometry equality operator fails on None — at Version 1

Reported by: denis@… Owned by: jbronn
Component: GIS Version: gis
Severity: Keywords: geos equals
Cc: Triage Stage: Unreviewed
Has patch: no Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: no UI/UX: no

Description (last modified by jbronn)

>>> from django.contrib.gis.geos import *
>>> Point(0, 0) == None
Traceback (most recent call last):
  File "<console>", line 1, in <module>
  File "/Library/Python/2.5/site-packages/django/contrib/gis/geos/base.py", line 170, in __eq__
    return self.equals_exact(other)
  File "/Library/Python/2.5/site-packages/django/contrib/gis/geos/base.py", line 318, in equals_exact
    return geos_equalsexact(self.ptr, other.ptr, float(tolerance))
AttributeError: 'NoneType' object has no attribute 'ptr'
>>> 

Change History (2)

comment:1 by jbronn, 16 years ago

Description: modified (diff)
Keywords: equals added
Owner: changed from nobody to jbronn

I agree that a TypeError should be raised instead -- at least an error is raised, so this is non-critical at the moment.

by jbronn, 16 years ago

Attachment: geos_eq.diff added
Note: See TracTickets for help on using tickets.
Back to Top