encoding py27 and py3