[gdal-dev] ogr.UseExceptions() doesn't raise an exception on a non-existant dataset [SEC=UNCLASSIFIED]

Pinner, Luke Luke.Pinner at environment.gov.au
Wed Oct 20 21:58:35 EDT 2010


OGR doesn't raise an exception on attempting to open a non-existant
dataset even if ogr.UseExceptions() has been called, GDAL does though.
Is this intentional or a bug?
GDAL version = 1.7.2

from osgeo import gdal,ogr
gdal.UseExceptions()
ogr.UseExceptions()

ds=ogr.Open('foo')
#No exception raised by ogr

ds=gdal.Open('foo')
Traceback (most recent call last):
  File "<interactive input>", line 1, in <module>
RuntimeError: `foo' does not exist in the file system,
and is not recognised as a supported dataset name.

Regards
Luke

If you have received this transmission in error please notify us immediately by return e-mail and delete all copies. If this e-mail or any attachments have been sent to you in error, that error does not constitute waiver of any confidentiality, privilege or copyright in respect of information in the e-mail or attachments.

Please consider the environment before printing this email.


More information about the gdal-dev mailing list