id summary reporter owner description type status priority milestone component version severity resolution keywords cc 5186 Exceptions raised in python error handlers do not propagate lpinner hobu "GDAL 1.10 on Ubuntu 13.04 and Win 7 Raising an exception within a custom python error handler when set by gdal.PushErrorHandler(py_function) does not work as expected - the exception gets raised in the function but does not propagate back to the main script. Below is an example to demonstrate: {{{ from osgeo import gdal def gdal_error_handler(err_class, err_no, err_msg): print 'About to raise Exception(%s)'%err_msg raise Exception('Raising Exception(%s)'%err_msg) print 'We will never see this' if __name__=='__main__': gdal.PushErrorHandler(gdal_error_handler) try: gdal.Error(gdal.CE_Failure,3,'test error message') except: print 'gdal.CE_Failure raised an exception' else: print 'gdal.CE_Failure did not raise an exception' gdal.PopErrorHandler() }}} Output: {{{ About to raise Exception(test error message) gdal.CE_Failure did not raise an exception }}} " enhancement closed normal closed_because_of_github_migration PythonBindings 1.10.0 normal wontfix PushErrorHandler Even Rouault