Handling OSError exception in Python
Let us see how to handle OSError Exceptions in Python. OSError is a built-in exception in Python and serves as the error class for the os module, which is raised when an os specific system function returns a system-related error, including I/O failures such as “file not found” or “disk full”.
Below is an example of OSError:
OSError: [Errno 25] Inappropriate ioctl for device
We can handle an OSError exception using try…except statements.
[Errno 25] Inappropriate ioctl for device File descriptor is not associated with any terminal device
My Personal Notes arrow_drop_up
Please Login to comment...