bpo-41052: Opt out serialization/deserialization for _random.Random by corona10 · Pull Request #21002 · python/cpython
from functools import partial from math import log, exp, pi, fsum, sin, factorial from test import support
@test.support.cpython_only def test_bug_41052(self): # _random.Random should not be allowed to serialization import _random for proto in range(pickle.HIGHEST_PROTOCOL + 1): r = _random.Random() self.assertRaises(TypeError, pickle.dumps, r, proto)
def test_bug_1727780(self): # verify that version-2-pickles can be loaded # fine, whether they are created on 32-bit or 64-bit