Bug 1899470 - python-asteval fails to build with Python 3.10: IndexError: list index out of range
Summary: python-asteval fails to build with Python 3.10: IndexError: list index out of...
Keywords:
Status: NEW
Alias: None
Product: Fedora
Classification: Fedora
Component: python-asteval
Version: rawhide
Hardware: Unspecified
OS: Unspecified
unspecified
unspecified
Target Milestone: ---
Assignee: Fabian Affolter
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
Depends On:
Blocks: PYTHON3.10
TreeView+ depends on / blocked
 
Reported: 2020-11-19 10:55 UTC by Tomáš Hrnčiar
Modified: 2021-02-09 16:24 UTC (History)
3 users (show)

Fixed In Version:
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed:
Type: Bug


Attachments (Terms of Use)

Description Tomáš Hrnčiar 2020-11-19 10:55:19 UTC
python-asteval fails to build with Python 3.10.0a2.

=================================== FAILURES ===================================
_____________________________ TestEval.test_kaboom _____________________________

self = <test_asteval.TestEval testMethod=test_kaboom>, chk_type = 'MemoryError'
chk_msg = ''

    def check_error(self, chk_type='', chk_msg=''):
        try:
>           errtype, errmsg = self.interp.error[0].get_error()
E           IndexError: list index out of range

tests/test_asteval.py:126: IndexError

During handling of the above exception, another exception occurred:

self = <test_asteval.TestEval testMethod=test_kaboom>

        def test_kaboom(self):
            """ test Ned Batchelder's 'Eval really is dangerous' - Kaboom test (and related tests)"""
            self.interp("""(lambda fc=(lambda n: [c for c in ().__class__.__bases__[0].__subclasses__() if c.__name__ == n][0]):
        fc("function")(fc("code")(0,0,0,0,"KABOOM",(),(),(),"","",0,""),{})()
    )()""")
            self.check_error('NotImplementedError', 'Lambda')  # Safe, lambda is not supported
    
            self.interp(
                """[print(c) for c in ().__class__.__bases__[0].__subclasses__()]""")  # Try a portion of the kaboom...
    
            self.check_error('AttributeError', '__class__')  # Safe, unsafe dunders are not supported
            self.interp("9**9**9**9**9**9**9**9")
            self.check_error('RuntimeError')  # Safe, safe_pow() catches this
            self.interp(
                "x = ((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((1))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))")
            if version_info == (3, 9):
                self.isvalue('x', 1)
                self.check_error(None)
            else:
>               self.check_error('MemoryError')  # Hmmm, this is caught, but its still concerning...

tests/test_asteval.py:909: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
tests/test_asteval.py:132: in check_error
    self.assertTrue(False)
E   AssertionError: False is not true
=========================== short test summary info ============================
FAILED tests/test_asteval.py::TestEval::test_kaboom - AssertionError: False i...
========================= 1 failed, 60 passed in 1.10s =========================
error: Bad exit status from /var/tmp/rpm-tmp.0Ap3fu (%check)


For the build logs, see:
https://copr-be.cloud.fedoraproject.org/results/@python/python3.10/fedora-rawhide-x86_64/01770345-python-asteval/

For all our attempts to build python-asteval with Python 3.10, see:
https://copr.fedorainfracloud.org/coprs/g/python/python3.10/package/python-asteval/

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.10:
https://copr.fedorainfracloud.org/coprs/g/python/python3.10/

Let us know here if you have any questions.

Python 3.10 will be included in Fedora 35. To make that update smoother, we're building Fedora packages with early pre-releases of Python 3.10.
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.

Comment 1 Ben Cotton 2021-02-09 15:26:07 UTC
This bug appears to have been reported against 'rawhide' during the Fedora 34 development cycle.
Changing version to 34.


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