That's not the problem.

This code will never reach line 29 becaue the line 25 will trigger `IndexError` exception. 

So there are a few ways of doing this (checking length of the specified filename, catching that exception, ...) but this cannot be merged in the current state.