Python Open Error Handling In Compiler