|
One possibility is that the file didn't open for any number of reasons. Actually, that's why they provide tests for that eventuality. Presuming that everything is going to work (including user input always being valid) is a serious mistake often made by beginners. It's something to get over as rapidly as you can if professional coding is your goal.
|