TypeError: must be str, not bytes

原文地址:http://hi.baidu.com/xpwgmvajbzbbgkq/item/9abbd6202ab126cbddf69aaf


Protocol version 3 was added in Python 3.0. It has explicit support for bytes and cannot be unpickled by Python 2.x pickle modules

f = open('draft.txt','w')  --------------> f = open('draft.txt','wb') 

f = open('draft.txt','r')  --------------> f = open('draft.txt','rb') 


你可能感兴趣的:(TypeError: must be str, not bytes)