fix some py3k compat issue

fix some py3k compat issue