#28569 closed Bug (fixed)
Broken error handling when fetching GDAL datasource layer by string.
| Reported by: | Nick Pope | Owned by: | Nick Pope |
|---|---|---|---|
| Component: | GIS | Version: | dev |
| Severity: | Normal | Keywords: | gdal datasource layer indexerror |
| Cc: | Triage Stage: | Unreviewed | |
| Has patch: | yes | Needs documentation: | no |
| Needs tests: | no | Patch needs improvement: | no |
| Easy pickings: | no | UI/UX: | no |
Description
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.
Change History (3)
comment:1 by , 8 years ago
| Has patch: | set |
|---|---|
| Owner: | changed from to |
| Status: | new → assigned |
Note:
See TracTickets
for help on using tickets.
PR