-
-
Notifications
You must be signed in to change notification settings - Fork 2.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Python: make gdal.UseExceptions() default to True #7452
Comments
The biggest hurdle will be GDAL's autotest suite, that relies on not-throwing in a likely big number of places. GDAL Python scripts will likely need changes to make them work with exceptions enabled |
One way to help users with the transition might be to put a check in, say, |
On a related note, a little while ago I added a context manager called ExceptionMgr to make it much easier to switch between the two states. #6637 I would also have loved exceptions to be on by default, but it feels like a huge job to change over. |
It's heavily used in #7475 |
Ah, very good! :-) |
Assigning milestone 4.0 for that one. In PR #7452, we set some grounds to make that happen |
It's been more than 15 years since
UseExceptions
was introduced with a default toFalse
to preserve backward compatibility with the ancient GDAL Python bindings.It is now time that those programmers who still have code depending on GDAL's behavior of not throwing need to update their code.
The text was updated successfully, but these errors were encountered: