Opened 9 years ago

Closed 9 years ago

#6075 closed defect (fixed)

gdal.OpenEx() ignores gdal.UseExceptions()

Reported by: cdestigter Owned by: hobu
Priority: normal Milestone: 2.1.0
Component: PythonBindings Version: svn-trunk
Severity: normal Keywords:
Cc: antonio


gdal.OpenEx('bogus.filename') doesn't trigger an exception, even if gdal.GetUseExceptions() == 1

Change History (4)

comment:1 by antonio, 9 years ago

Cc: antonio added

comment:2 by Even Rouault, 9 years ago

With gdal.OpenEx() verbose errors have to be explicitly asked with gdal.OpenEx(filename, gdal.OF_VERBOSE_ERROR), and when UseExceptions() is set, this will cause the exception to be triggered.

I've a local patch that if GetUseExceptions() is set will also set gdal.OF_VERBOSE_ERROR, so that an exception is automatically thrown, but I'm somewhat ambivalent about it. Opinions welcome.

comment:3 by cdestigter, 9 years ago

Thanks, I'll add that flag.

IMHO making UseExceptions() set OF_VERBOSE_ERROR would be ideal :)

comment:4 by Even Rouault, 9 years ago

Milestone: 2.1.0
Resolution: fixed
Status: newclosed

trunk r29716 "Python bindings: make gdal.OpenEx() throw a Python exception in case of failed open when exceptions are enables with gdal.UseExceptions() (#6075)"

Note: See TracTickets for help on using tickets.