相关疑难解决方法(0)

使用python 3取消python 2对象

我想知道是否有任何方法可以加载Python 2.4中使用Python 3.4进行pickle的对象.

我已经在大量公司遗留代码上运行2to3以使其保持最新状态.

完成此操作后,运行该文件时出现以下错误:

  File "H:\fixers - 3.4\addressfixer - 3.4\trunk\lib\address\address_generic.py"
, line 382, in read_ref_files
    d = pickle.load(open(mshelffile, 'rb'))
UnicodeDecodeError: 'ascii' codec can't decode byte 0xe2 in position 1: ordinal
not in range(128)
Run Code Online (Sandbox Code Playgroud)

寻找在争用酸洗对象,这是一个dict在一个dict,包含类型的键和值str.

所以我的问题是:有没有办法加载一个对象,最初在python 2.4中使用python 3.4进行腌制?

python pickle python-2.4 python-2to3 python-3.x

114
推荐指数
2
解决办法
7万
查看次数

标签 统计

pickle ×1

python ×1

python-2.4 ×1

python-2to3 ×1

python-3.x ×1