Python 3.6.0的那些坑(1)

1.TypeError: write() argument must be str, not bytes

原来:

pickle.dump(actions, open(dump_path, 'w'))

修改后

pickle.dump(actions, open(dump_path, 'wb'))

2.UnicodeDecodeError: ‘gbk’ codec can’t decode byte 0x80 in position 0: illegal multibyte sequence

原来:

actions = pickle.load(open(dump_path))

修改后

actions = pickle.load(open(dump_path,'rb'))

你可能感兴趣的:(大数据,python,Windows,脚本,机器学习&深度学习)