Fix python 3 problem: 'str' does not support the buffer interface