fix "argument 2 must be str, not unicode" on python 2.6 and python 2.7