Fix py3 str has no buffer interface