#35681: GeoIP2Exception does not work as advertised
------------------------------+------------------------------------
     Reporter:  Jon Ribbens   |                    Owner:  (none)
         Type:  Bug           |                   Status:  new
    Component:  GIS           |                  Version:  5.1
     Severity:  Normal        |               Resolution:
     Keywords:  geoip geoip2  |             Triage Stage:  Accepted
    Has patch:  0             |      Needs documentation:  0
  Needs tests:  0             |  Patch needs improvement:  0
Easy pickings:  1             |                    UI/UX:  0
------------------------------+------------------------------------
Comment (by Jon Ribbens):

 I mean it unarguably is a very thin wrapper. It does very little except
 transform the returned data from geoip2 objects to dictionaries, which I
 can only assume somebody needed for serialization purposes. Frankly the
 most useful thing it could do would be to automatically create a geoip2
 `Reader` object when the django application loads, so that you don't need
 to manually manage that yourself, and it doesn't even do that.

 You're simultaneously saying that the wrapper isn't thin but also that the
 solution to the issue here is to make a hole in it. These two positions
 seem to me to be contradictory.

 Having said that, in principle your suggested solution is certainly an
 improvement. The most important bit is that the documentation needs to
 stop claiming that the wrapper intercepts and re-raises the underlying
 geoip2 exceptions, because it doesn't do that, and anyone who doesn't
 realise that the documentation is false will have bugs in their code. (In
 particular, AddressNotFoundError **will** happen in normal everyday use,
 and you have to cope with it.)

 The bit about docstrings though, the current code doesn't seem to use any
 sort of docstring standard, and doesn't even note the exceptions that the
 code explicitly raises. I'm not sure changing docstrings will make any
 difference to anything.
-- 
Ticket URL: <https://code.djangoproject.com/ticket/35681#comment:8>
Django <https://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 unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-updates/01070191bce4f101-2de10bc2-0a34-4510-b484-817cb4e439de-000000%40eu-central-1.amazonses.com.

Reply via email to