fixed TypeError "Expected str, got unicode" under Python 2.7