◐ Shell
clean mode source ↗

Message 110462 - Python tracker

> Revision 68903 was merged in py3k in r68908.  It looks like a similar issue shows up in test_random:
> 
> ======================================================================
> ERROR: test_pickling (test.test_random.MersenneTwister_TestBasicOps)
> ----------------------------------------------------------------------
> Traceback (most recent call last):
>   File "/home/buildbot/slave/py-build/3.1.norwitz-amd64/build/Lib/test/test_random.py", line 107, in test_pickling
>     state = pickle.dumps(self.gen)
>   File "/home/buildbot/slave/py-build/3.1.norwitz-amd64/build/Lib/pickle.py", line 1358, in dumps
>     Pickler(f, protocol, fix_imports=fix_imports).dump(obj)
> _pickle.PicklingError: Can't pickle <class 'random.Random'>: it's not the same object as random.Random

Actually, this might have to do with the fix I committed to
test_threaded_import in r82885.
In order for test_threaded_import to work, we have to unload the "Guinea
pig" module before importing it from several threads at once. For
whatever reason, test_threaded_import uses random as its Guinea pig
module, which means random gets unloaded and reimported again.

But at this point, I must admit I don't even understand the failure
message.