This is a huge try/except. You should limit the exception catching to the absolute minimum. You can `try/except/else`