Python FileNotFoundError: Difference between revisions

From NovaOrdis Knowledge Base
Jump to navigation Jump to search
 
Line 4: Line 4:
Thrown by file-related functions when the file is not found.
Thrown by file-related functions when the file is not found.


To access the error message: <code>e.strerror</code>.
To access the error message: <code>e.strerror</code>, which by default is "No such file or directory".
 
The full error message includes also the file in question, which can be accessed with <code>e.filename</code>.

Latest revision as of 04:19, 10 August 2022

Internal

Overview

Thrown by file-related functions when the file is not found.

To access the error message: e.strerror, which by default is "No such file or directory".

The full error message includes also the file in question, which can be accessed with e.filename.