improve msg for better debug when OSError

Here I just change to new syntax and change the name of the variable to e (it is the name in whole repo)