def test_bad_mark(self):
badpickles = [
# 'N(.', # STOP
'N(2', # DUP
'c__builtin__\nlist\n)(R', # REDUCE
'c__builtin__\nlist\n()R',
']N(a', # APPEND
# BUILD
'c__builtin__\nValueError\n)R}(b',
'c__builtin__\nValueError\n)R(}b',
'(Nd', # DICT
'N(p1\n', # PUT
'N(q\x00', # BINPUT
'N(r\x00\x00\x00\x00', # LONG_BINPUT
'}NN(s', # SETITEM
'}N(Ns',
'}(NNs',
'}((u', # SETITEMS
# NEWOBJ
'c__builtin__\nlist\n)(\x81',
'c__builtin__\nlist\n()\x81',
'N(\x85', # TUPLE1
'NN(\x86', # TUPLE2
'N(N\x86',
'NNN(\x87', # TUPLE3
'NN(N\x87',
'N(NN\x87',
]
for p in badpickles:
self.check_unpickling_error(self.bad_mark_errors, p)
评论列表
文章目录