Issue with pickling an unpickled object
还没有人认领这个 Issue。
评估
调研方向
首先,使用提供的类方法和字节码详细信息,在 Python 3.9.6 和 cloudpickle 2.0.0 下重现报告的往返过程。跟踪第二次 cloudpickle 操作经过字节码处理并到达 dis.py 的过程;当对象能够在不出现 IndexError 的情况下再次进行 pickle,并且回归问题由可复现的测试覆盖时,即可认为该问题已完成。
由索引模型根据 Issue 内容生成。
描述
Python 3.9.6 | cloudpickle 2.0.0
While using cloudpickle to pack some classes, I encountered the following error:
\lib\dis.py", line 347, in _get_instructions_bytes argval = cmp_op[arg] IndexError: tuple index out of range
arg = 6
op = 107
Here is the segment of code (a class method) it was processing when the error occurred:
def startTimer(self,name):
if name in self.timers and not self.timers[name]['start'] is None:
if self.timers[name]['stop'] is None:
print(f"Timer ({name}) has already been started..")
return
else:
print(f"Timer ({name}) being restarted from last stop ({self.timers[name]['stop']})")
self.timers[name]={"start":time(),"stop":None}
Here is the bytecode:
b't\x00d\x01d\x02\x8d\x01|\x00_\x01d\x03g\x01|\x00_\x02d\x04|\x00_\x03g\x00|\x00_\x04d\x00|\x00_\x05|\x01|\x00_\x06|\x00\xa0\x07\xa1\x00\x01\x00t\x08|\x00j\x01\x83\x01\x01\x00d\x00S\x00'
Here is the unpacked code:
[(0, 116, 0), (2, 100, 1), (4, 100, 2), (6, 141, 1), (8, 124, 0), (10, 95, 1), (12, 100, 3), (14, 103, 1), (16, 124, 0), (18, 95, 2), (20, 100, 4), (22, 124, 0), (24, 95, 3), (26, 103, 0), (28, 124, 0), (30, 95, 4), (32, 100, 0), (34, 124, 0), (36, 95, 5), (38, 124, 1), (40, 124, 0), (42, 95, 6), (44, 124, 0), (46, 160, 7), (48, 161, 0), (50, 1, None), (52, 116, 8), (54, 124, 0), (56, 106, 1), (58, 131, 1), (60, 1, None), (62, 100, 0), (64, 83, None)]
This is happening when I try to re-cloudpickle an object that was already pickled and loaded with cloudpickle. The original pickling goes through fine, I am able to unpack it without issues, but when I try to re-pickle the unpacked object again I get the above error.
- 主要语言
- Python
- 星标
- 1.9k
- 派生
- 197
- 平均合并
- 1 天 10 小时
- 30 天内合并 PR
- 1
贡献指南
这个仓库没有索引到贡献指南
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
cloudpipe/cloudpickle 的其他 Issue
-
难度 2/5 1-3 小时 新手友好度 78/100
cloudpipe/cloudpickle#593 · 1 条评论 ·
-
难度 4/5 3-5 天 新手友好度 42/100
cloudpipe/cloudpickle#595 ·
-
难度 3/5 1-2 天 新手友好度 65/100
cloudpipe/cloudpickle#592 · 2 条评论 ·
-
难度 5/5 一周以上 新手友好度 35/100
cloudpipe/cloudpickle#589 ·
-
难度 5/5 一周以上 新手友好度 20/100
cloudpipe/cloudpickle#587 ·
查看 cloudpipe/cloudpickle 的全部 Issue
相似的 Issue
-
难度 1/5 1 小时以内 新手友好度 75/100
-
hcocena 未关闭policies-accepted pre-review precheck-passed
难度 1/5 1 小时以内 新手友好度 88/100
Bioconductor/BiocContributions#214 · 5 条评论 ·
-
难度 1/5 1 小时以内 新手友好度 92/100
TencentCloud/Octop#1169 · 1 条评论 ·
-
难度 2/5 1-3 小时 新手友好度 70/100
521xueweihan/HelloGitHub#3778 ·
-
The version checker's trailing attribute region has no control for a less-than inside a quoted value 未关闭area: dashboard area: tests bug perceived difficulty: 2 python
难度 2/5 1-3 小时 新手友好度 84/100
Nitjsefnie-Harness-Commons/daedalus#1105 · 1 条评论 ·