[python] python driver throws exception which is can not catch when using cursor after connection close