Bug 2101963

Summary: python-astropy fails to build with Python 3.11: TypeError: unbound method object.__getstate__() needs an argument
Product: [Fedora] Fedora Reporter: Miro Hrončok <mhroncok>
Component: python-astropyAssignee: Sergio Pascual <sergio.pasra>
Status: CLOSED RAWHIDE QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: 37CC: code, orion, sergio.pasra
Target Milestone: ---   
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2023-04-30 10:18:21 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Bug Depends On:    
Bug Blocks: 2016048, 2045102, 2107826, 2117176, 2168842    

Description Miro Hrončok 2022-06-28 22:17:13 UTC
A de-bootstrapped build of python-astropy fails to build with Python 3.11:

=================================== FAILURES ===================================
_______ test_simple_object[0-StaticMatrixTransform-args6-kwargs6-False] ________
pickle_protocol = 0
name = <class 'astropy.coordinates.transformations.StaticMatrixTransform'>
args = [array([[1., 0., 0.],
       [0., 1., 0.],
       [0., 0., 1.]]), <class 'astropy.coordinates.builtin_frames.icrs.ICRS'>, <class 'astropy.coordinates.builtin_frames.icrs.ICRS'>]
kwargs = {}, xfail = False
    @pytest.mark.parametrize(("name", "args", "kwargs", "xfail"),
                             zip(_names, _args, _kwargs, _xfail))
    def test_simple_object(pickle_protocol, name, args, kwargs, xfail):
        # Tests easily instantiated objects
        if xfail:
            pytest.xfail()
        original = name(*args, **kwargs)
>       check_pickling_recovery(original, pickle_protocol)
astropy/coordinates/tests/test_pickle.py:71: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
astropy/tests/helper.py:446: in check_pickling_recovery
    generic_recursive_equality_test(original, unpickled,
astropy/tests/helper.py:433: in generic_recursive_equality_test
    generic_recursive_equality_test(dict_a[key],
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
a = <class 'astropy.coordinates.builtin_frames.icrs.ICRS'>
b = <class 'astropy.coordinates.builtin_frames.icrs.ICRS'>
class_history = [<class 'abc.ABCMeta'>, <class 'astropy.coordinates.transformations.StaticMatrixTransform'>]
    def generic_recursive_equality_test(a, b, class_history):
        """
        Check if the attributes of a and b are equal. Then,
        check if the attributes of the attributes are equal.
        """
>       dict_a = a.__getstate__() if hasattr(a, '__getstate__') else a.__dict__
E       TypeError: unbound method object.__getstate__() needs an argument
astropy/tests/helper.py:415: TypeError


Note that all objects now have __getstate__. See for example https://github.com/jsonpickle/jsonpickle/pull/396

Comment 1 Miro Hrončok 2022-08-01 21:48:11 UTC
This package now has old Python bytecode (see bz2107826), could you please fix this and rebuild it on Fedora 37+?

Comment 2 Sergio Pascual 2022-08-03 18:48:29 UTC
I have reported the __getstate__ problem upstream

Comment 3 Ben Cotton 2022-08-09 13:39:52 UTC
This bug appears to have been reported against 'rawhide' during the Fedora Linux 37 development cycle.
Changing version to 37.

Comment 4 Ben Beasley 2022-11-26 14:32:30 UTC
This is supposed to be fixed upstream[1] and released in 5.1.1[2]. Could we get an update and rebuild of the Fedora package, please? Thanks!

[1] https://github.com/astropy/astropy/pull/13614
[2] https://github.com/astropy/astropy/blob/v5.1.1/CHANGES.rst#version-511-2022-10-23

Comment 5 Sergio Pascual 2022-12-16 00:31:53 UTC
I'm going to rebuild cfitsio in Rawhide, so I will rebuild python-astropy also