fix python open file issue