#28569: Broken error handling when fetching GDAL datasource layer by string.
-------------------------------------+-------------------------------------
               Reporter:  Nick Pope  |          Owner:  nobody
                   Type:  Bug        |         Status:  new
              Component:  GIS        |        Version:  master
               Severity:  Normal     |       Keywords:  gdal datasource
           Triage Stage:             |  layer indexerror
  Unreviewed                         |      Has patch:  0
    Needs documentation:  0          |    Needs tests:  0
Patch needs improvement:  0          |  Easy pickings:  0
                  UI/UX:  0          |
-------------------------------------+-------------------------------------
 When working on ticket #28558, I noticed that the error handling was
 broken in the case of accessing a layer on a datasource by string name.

 The `get_layer_by_name` function raised `GDALException` instead of
 returning `None` in the case of an invalid string name as is expected by
 `DataSource.__getitem__`.

 Looking at all of the other `get_*_by_name` functions, they pass
 `errcheck=False` to avoid an exception being raised.

 It seems as though this has been broken from the initial implementation.

-- 
Ticket URL: <https://code.djangoproject.com/ticket/28569>
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 post to this group, send email to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-updates/050.5d5790e34abf8caddd2617f44b7c5f7c%40djangoproject.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to