[問題] Python 2.x 3.x pickle 不相容
Python 2.7 把一個 datetime.datetime 物件打包成 bytes 傳給 Python 3.2
Python 3.2 卻沒辦法把這些 bytes 還原成 datetime.datetime 物件
錯誤訊息如下
UnicodeDecodeError: 'ascii' codec can't decode byte 0xdc in position 1:
ordinal not in range(128)
試過用其他 codec,一樣噴 UnicodeDecodeError 出來
改其他 pickle protocol,也一樣噴 UnicodeDecodeError 出來
請問這是為什麼?照理說 pickle module 應該能相容才對呀?
--
※ 發信站: 批踢踢實業坊(ptt.cc)
◆ From: 114.46.136.29
推
09/06 11:18, , 1F
09/06 11:18, 1F
推
09/06 11:26, , 2F
09/06 11:26, 2F
→
09/06 11:26, , 3F
09/06 11:26, 3F
→
09/06 11:26, , 4F
09/06 11:26, 4F
討論串 (同標題文章)
以下文章回應了本文:
完整討論串 (本文為第 1 之 2 篇):
Python 近期熱門文章
PTT數位生活區 即時熱門文章