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
imread Should Raise If Path Doesn't Exist #14095
Comments
Mentioned API assumes that empty ( |
@alalek What's about to add : and new user can set to 1 if they want exception ? |
Yes, without raising exceptions here, bugs can't be located in time. |
@alalek I much prefer breaking changes to mismatched expectations. Why would this "break existed OpenCV applications?" Also why are those applications using this special fake "NoneType" thing anyway? |
Current imread documentation says:
From a software-development-best-practices standpoint, this is completely unacceptable. Nowhere will you find advice like the following:
Instead, the advice you typically find is something like (emphasis added):
So, at the very least, |
i am working on #17753 and planning to work also on error handling. now waiting a review to continue |
|
System information (version)
Detailed description
cv2.imread
doesn't check file existence and reads nonexistent files into a NoneType object. In comparison,matplotlib.pyplot.imread
andPIL
both throw.Steps to reproduce
The text was updated successfully, but these errors were encountered: