_pickle.UnpicklingError仅在通过SFTP移动文件后引发

时间:2017-05-30 14:39:44

标签: python pickle

我的服务器上有一个文件,我可以使用pickle打开。

import pickle
f = open('filename.pckl','rb')
file = pickle.load(f)
# works fine

然而,在我将它从我的服务器移动到我的本地电脑,使用filezilla或通过Git合并之后,就会发生这种情况。

import pickle
f = open('filename.pckl','rb')
file = pickle.load(f)
Traceback (most recent call last):
  File "<stdin>", line 3, in <module>
_pickle.UnpicklingError: the STRING opcode argument must be quoted

如何在移动后打开我的腌制文件?

0 个答案:

没有答案