apply the encoding fix only with python2