Fedora Account System
Red Hat Associate
Red Hat Customer
python-cloudpickle fails to build with Python 3.9.0a3. =================================== FAILURES =================================== ____________ CloudPickleTest.test_reducer_override_reference_cycle _____________ self = <tests.cloudpickle_test.CloudPickleTest testMethod=test_reducer_override_reference_cycle> @pytest.mark.skipif( platform.python_implementation() != "CPython" or (sys.version_info >= (3, 8, 0) and sys.version_info < (3, 8, 2)), reason="Underlying bug fixed upstream starting Python 3.8.2") def test_reducer_override_reference_cycle(self): # Early versions of Python 3.8 introduced a reference cycle between a # Pickler and it's reducer_override method. Because a Pickler # object references every object it has pickled through its memo, this # cycle prevented the garbage-collection of those external pickled # objects. See #327 as well as https://bugs.python.org/issue39492 # This bug was fixed in Python 3.8.2, but is still present using # cloudpickle and Python 3.8.0/1, hence the skipif directive. class MyClass: pass my_object = MyClass() wr = weakref.ref(my_object) cloudpickle.dumps(my_object) del my_object > assert wr() is None, "'del'-ed my_object has not been collected" E AssertionError: 'del'-ed my_object has not been collected E assert <tests.cloudpickle_test.CloudPickleTest.test_reducer_override_reference_cycle.<locals>.MyClass object at 0x7f9a2e83c3a0> is None E + where <tests.cloudpickle_test.CloudPickleTest.test_reducer_override_reference_cycle.<locals>.MyClass object at 0x7f9a2e83c3a0> = <weakref at 0x7f9a324179a0; to 'MyClass' at 0x7f9a2e83c3a0>() tests/cloudpickle_test.py:131: AssertionError ________ Protocol2CloudPickleTest.test_reducer_override_reference_cycle ________ self = <tests.cloudpickle_test.Protocol2CloudPickleTest testMethod=test_reducer_override_reference_cycle> @pytest.mark.skipif( platform.python_implementation() != "CPython" or (sys.version_info >= (3, 8, 0) and sys.version_info < (3, 8, 2)), reason="Underlying bug fixed upstream starting Python 3.8.2") def test_reducer_override_reference_cycle(self): # Early versions of Python 3.8 introduced a reference cycle between a # Pickler and it's reducer_override method. Because a Pickler # object references every object it has pickled through its memo, this # cycle prevented the garbage-collection of those external pickled # objects. See #327 as well as https://bugs.python.org/issue39492 # This bug was fixed in Python 3.8.2, but is still present using # cloudpickle and Python 3.8.0/1, hence the skipif directive. class MyClass: pass my_object = MyClass() wr = weakref.ref(my_object) cloudpickle.dumps(my_object) del my_object > assert wr() is None, "'del'-ed my_object has not been collected" E AssertionError: 'del'-ed my_object has not been collected E assert <tests.cloudpickle_test.CloudPickleTest.test_reducer_override_reference_cycle.<locals>.MyClass object at 0x7f9a2ed11c10> is None E + where <tests.cloudpickle_test.CloudPickleTest.test_reducer_override_reference_cycle.<locals>.MyClass object at 0x7f9a2ed11c10> = <weakref at 0x7f9a2ebb6cc0; to 'MyClass' at 0x7f9a2ed11c10>() tests/cloudpickle_test.py:131: AssertionError This seems like something that will naturally go away with the next 3.9.0 pre-release, according to the long skipif comment and investigating the CPython bug. a4 is scheduled for tomorrow, hence I propose we wait for that and re-test. For the build logs, see: https://copr-be.cloud.fedoraproject.org/results/@python/python3.9/fedora-rawhide-x86_64/01249349-python-cloudpickle/ For all our attempts to build python-cloudpickle with Python 3.9, see: https://copr.fedorainfracloud.org/coprs/g/python/python3.9/package/python-cloudpickle/ Testing and mass rebuild of packages is happening in copr. You can follow these instructions to test locally in mock if your package builds with Python 3.9: https://copr.fedorainfracloud.org/coprs/g/python/python3.9/ Let us know here if you have any questions. Python 3.9 will be included in Fedora 33. To make that update smoother, we're building Fedora packages with early pre-releases of Python 3.9. A build failure prevents us from testing all dependent packages (transitive [Build]Requires), so if this package is required a lot, it's important for us to get it fixed soon. We'd appreciate help from the people who know this package best, but if you don't want to work on this now, let us know so we can try to work around it on our side.
3.9.0a4 indeed fixes this. Sorry for the noise.