• Home
  • Raw
  • Download

Lines Matching refs:pickled

1077         pickled = b'((lp100000\ng100000\nt.'
1078 unpickled = self.loads(pickled)
1083 pickled = b'(]q\xffh\xfft.'
1084 unpickled = self.loads(pickled)
1089 pickled = b'(]r\x00\x00\x01\x00j\x00\x00\x01\x00t.'
1090 unpickled = self.loads(pickled)
1095 pickled = b'((l2t.'
1096 unpickled = self.loads(pickled)
1141 pickled = b'\x80\x04\x95\x05\x00\x00\x00\x00\x00\x00\x00I42\n.'
1146 self.assertEqual(self.loads(pickled), 42)
1150 pickled = b'\x80\x02c__builtin__\nxrange\nK\x01K\x07K\x01\x87R.'
1151 unpickled = self.loads(pickled)
1156 pickled = b'\x80\x02c__builtin__\nreduce\n.'
1157 self.assertIs(self.loads(pickled), functools.reduce)
1159 pickled = b'\x80\x02cwhichdb\nwhichdb\n.'
1160 self.assertIs(self.loads(pickled), dbm.whichdb)
1163 pickled = (b'\x80\x02cexceptions\n' + name + b'\nU\x03ugh\x85R.')
1164 unpickled = self.loads(pickled)
1169 pickled = (b'\x80\x02(cUserDict\n' + name +
1171 unpickled = self.loads(pickled)
1821 pickled = self.dumps(None, proto)
1824 self.assertTrue(pickled.startswith(proto_header))
1826 self.assertEqual(count_opcode(pickle.PROTO, pickled), 0)
2306 pickled = self.dumps(obj, proto)
2307 self.assertTrue(opcode_in_pickle(opcode, pickled))
2308 unpickled = self.loads(pickled)
2333 def check_frame_opcodes(self, pickled): argument
2344 for op, arg, pos in pickletools.genops(pickled):
2374 pos = len(pickled)
2385 pickled = self.dumps(obj, proto)
2386 unpickled = self.loads(pickled)
2388 bytes_per_frame = (len(pickled) /
2389 count_opcode(pickle.FRAME, pickled))
2394 self.check_frame_opcodes(pickled)
2406 pickled = self.dumps(obj, proto)
2415 pickled = buf.getvalue()
2416 unpickled = self.loads(pickled)
2422 n_frames = count_opcode(pickle.FRAME, pickled)
2426 self.check_frame_opcodes(pickled)
2432 def remove_frames(pickled, keep_frame=None): argument
2437 for opcode, _, pos in pickletools.genops(pickled):
2446 newpickle += pickled[last_frame_end:pos]
2448 newpickle += pickled[last_frame_end:]
2459 pickled = self.dumps(obj, proto)
2461 frameless_pickle = remove_frames(pickled)
2465 some_frames_pickle = remove_frames(pickled, lambda i: i % 2)
2467 count_opcode(pickle.FRAME, pickled))
2499 pickled = writer.concatenate_chunks()
2500 reconstructed = self.loads(pickled)
2507 self.assertEqual(writer.concatenate_chunks(), pickled)
2509 n_frames = (len(pickled) - 1) // self.FRAME_SIZE_TARGET + 1
2659 pickled = self.dumps(val, proto)
2660 self.assertIn(('c%s\n%s' % (mod, name)).encode(), pickled)
2661 self.assertIs(type(self.loads(pickled)), type(val))
2900 pickled = self.dumps(data, protocol=proto)
2903 data_start = pickled.index(data)
2906 pickled[data_start-len(header):data_start])
2908 pickled = None
2927 pickled = self.dumps(data, protocol=proto)
2930 data_start = pickled.index(data)
2933 pickled[data_start-len(header):data_start])
2935 pickled = None
2951 pickled = self.dumps(data, protocol=proto)
2954 data_start = pickled.index(b'abcd')
2957 pickled[data_start-len(header):data_start])
2958 self.assertEqual((pickled.rindex(b"abcd") + len(b"abcd") -
2959 pickled.index(b"abcd")), len(data))
2961 pickled = None
2982 pickled = self.dumps(data, protocol=proto)
2985 data_start = pickled.index(b'abcd')
2988 pickled[data_start-len(header):data_start])
2989 self.assertEqual((pickled.rindex(b"abcd") + len(b"abcd") -
2990 pickled.index(b"abcd")), len(data))
2992 pickled = None
3302 pickled = pickle.PERSID + non_ascii_str.encode('utf-8') + b'\n.'
3303 self.assertRaises(pickle.UnpicklingError, self.loads, pickled)
3427 pickled = f.getvalue()
3430 f = ioclass(pickled * N)
3437 self.assertEqual(f.tell(), pos + len(pickled))