os.write only accept a buffer interface in python 3.3