Opened 8 years ago

Closed 8 years ago

#27103 closed Bug (fixed)

GDAL driver ensure_registered should check counts separately

Reported by: Matthew Somerville Owned by: nobody
Component: GIS Version: 1.10
Severity: Normal Keywords:
Cc: Triage Stage: Accepted
Has patch: yes Needs documentation: no
Needs tests: yes Patch needs improvement: no
Easy pickings: no UI/UX: no

Description

It is possible for external code to register some of the drivers, and then Django code will die because it expects them all to have been registered. For example, on a standard Debian box (wheezy or jessie), the following code works fine:

from django.contrib.gis.gdal import DataSource
ds = DataSource('/home/matthew/data.shp')

whilst the following code dies saying the file could not be loaded:

from osgeo import gdal
from django.contrib.gis.gdal import DataSource
ds = DataSource('/home/matthew/data.shp')

This is because the osgeo import has registered the raster drivers, but not the data source ones, and yet Django's ensure_registered will only try and register both if the overall count is zero.

Change History (2)

comment:1 by Tim Graham, 8 years ago

Needs tests: set
Triage Stage: UnreviewedAccepted

comment:2 by Tim Graham <timograham@…>, 8 years ago

Resolution: fixed
Status: newclosed

In fb951fb0:

Fixed #27103 -- Registered vcapi/rcapi GDAL prototypes based on their own drivers.

Note: See TracTickets for help on using tickets.
Back to Top