fixed TypeError: 'str' does not support the buffer interfacein python 3