python3遇到的问题

a bytes-like object is required,not str':python

问题出在python3.5和Python2.7在套接字返回值解码上有区别:
python bytes和str两种类型能够经过函数encode()和decode()相互转换,str经过encode()方法能够转换为bytes。反过来,若是咱们从网络或磁盘上读取了字节流,那么读到的数据就是bytes。要把bytes变为str,就须要用decode()方法。
网络