Bug 2101963 - python-astropy fails to build with Python 3.11: TypeError: unbound method object.__getstate__() needs an argument
Summary: python-astropy fails to build with Python 3.11: TypeError: unbound method obj...
Keywords:
Status: CLOSED RAWHIDE
Alias: None
Product: Fedora
Classification: Fedora
Component: python-astropy
Version: 37
Hardware: Unspecified
OS: Unspecified
unspecified
unspecified
Target Milestone: ---
Assignee: Sergio Pascual
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
Depends On:
Blocks: F38FTBFS F39FTBFS PYTHON3.11 F37FTBFS 2107826
TreeView+ depends on / blocked
 
Reported: 2022-06-28 22:17 UTC by Miro Hrončok
Modified: 2023-04-30 10:18 UTC (History)
3 users (show)

Fixed In Version:
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed: 2023-04-30 10:18:21 UTC
Type: Bug
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Github astropy astropy issues 13522 0 None open Test faillure with Python 3.11: default __getstate__ implementation 2022-08-03 18:48:28 UTC

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


Note You need to log in before you can comment on or make changes to this bug.