python - Raising a FileNotFoundError - Stack Overflow
In python3, if you try to open a file that doesn't exist, the call to open will automatically throw a FileNotFoundError for you. In python2.7, it throws an IOError, but the idea is the same. What python version are you running, and do you specifically need the former error? – Chris Sprague Jun 16, 2016 at 21:00