#7873: GEOSGeometry equality operator fails on None
--------------------------------------+-------------------------------------
          Reporter:  [EMAIL PROTECTED]  |         Owner:  jbronn     
            Status:  new              |     Milestone:             
         Component:  GIS              |       Version:  gis        
        Resolution:                   |      Keywords:  geos equals
             Stage:  Unreviewed       |     Has_patch:  0          
        Needs_docs:  0                |   Needs_tests:  0          
Needs_better_patch:  0                |  
--------------------------------------+-------------------------------------
Changes (by jbronn):

  * needs_better_patch:  => 0
  * needs_tests:  => 0
  * owner:  nobody => jbronn
  * keywords:  geos => geos equals
  * needs_docs:  => 0

Old description:

> >>> 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'
> >>>

New description:

 {{{
 >>> 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'
 >>>
 }}}

Comment:

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

-- 
Ticket URL: <http://code.djangoproject.com/ticket/7873#comment:1>
Django Code <http://code.djangoproject.com/>
The web framework for perfectionists with deadlines
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Django updates" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/django-updates?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to