Python Open Error Handling In C