resolve the freezing problem in python babel mode