python-cffi fails to build with Python 3.11.0a3. =================================== FAILURES =================================== ___________________________ test_callback_exception ____________________________ def test_callback_exception(): try: import cStringIO except ImportError: import io as cStringIO # Python 3 import linecache def matches(istr, ipattern, ipattern38): if sys.version_info >= (3, 8): ipattern = ipattern38 str, pattern = istr, ipattern while '$' in pattern: i = pattern.index('$') assert str[:i] == pattern[:i] j = str.find(pattern[i+1], i) assert i + 1 <= j <= str.find('\n', i) str = str[j:] pattern = pattern[i+1:] assert str == pattern return True def check_value(x): if x == 10000: raise ValueError(42) def Zcb1(x): check_value(x) return x * 3 BShort = new_primitive_type("short") BFunc = new_function_type((BShort,), BShort, False) f = callback(BFunc, Zcb1, -42) # seen = [] oops_result = None def oops(*args): seen.append(args) return oops_result ff = callback(BFunc, Zcb1, -42, oops) # orig_stderr = sys.stderr orig_getline = linecache.getline try: linecache.getline = lambda *args: 'LINE' # hack: speed up PyPy tests sys.stderr = cStringIO.StringIO() if hasattr(sys, '__unraisablehook__'): # work around pytest sys.unraisablehook = sys.__unraisablehook__ # on recent CPythons assert f(100) == 300 assert sys.stderr.getvalue() == '' assert f(10000) == -42 > assert matches(sys.stderr.getvalue(), """\ From cffi callback <function$Zcb1 at 0x$>: Traceback (most recent call last): File "$", line $, in Zcb1 $ File "$", line $, in check_value $ ValueError: 42 """, """\ Exception ignored from cffi callback <function$Zcb1 at 0x$>: Traceback (most recent call last): File "$", line $, in Zcb1 $ File "$", line $, in check_value $ ValueError: 42 """) c/test_c.py:1374: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ istr = 'Exception ignored from cffi callback <function test_callback_exception.<locals>.Zcb1 at 0x7f18c40b94e0>:\nTraceback (...i-1.15.0/c/test_c.py", line 1349, in check_value\n raise ValueError(42)\n ^^^^^^^^^^^^^^^^^^^^\nValueError: 42\n' ipattern = 'Exception ignored from cffi callback <function$Zcb1 at 0x$>:\nTraceback (most recent call last):\n File "$", line $, in Zcb1\n $\n File "$", line $, in check_value\n $\nValueError: 42\n' ipattern38 = 'Exception ignored from cffi callback <function$Zcb1 at 0x$>:\nTraceback (most recent call last):\n File "$", line $, in Zcb1\n $\n File "$", line $, in check_value\n $\nValueError: 42\n' def matches(istr, ipattern, ipattern38): if sys.version_info >= (3, 8): ipattern = ipattern38 str, pattern = istr, ipattern while '$' in pattern: i = pattern.index('$') > assert str[:i] == pattern[:i] E assert '\n ^^^^' == '\n File "' E E - File " E + ^^^^ c/test_c.py:1340: AssertionError https://docs.python.org/3.11/whatsnew/3.11.html For the build logs, see: https://copr-be.cloud.fedoraproject.org/results/@python/python3.11/fedora-rawhide-x86_64/03142518-python-cffi/ For all our attempts to build python-cffi with Python 3.11, see: https://copr.fedorainfracloud.org/coprs/g/python/python3.11/package/python-cffi/ 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.11: https://copr.fedorainfracloud.org/coprs/g/python/python3.11/ Let us know here if you have any questions. Python 3.11 is planned to be included in Fedora 37. To make that update smoother, we're building Fedora packages with all pre-releases of Python 3.11. 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.
Seems like a new form of a traceback that includes more information. Tomáš, could you please update the test upstream if not already done? It already has "if sys.version_info >= (3, 8):". I can help if needed. Thanks. https://foss.heptapod.net/pypy/cffi
Upstream PR: https://foss.heptapod.net/pypy/cffi/-/merge_requests/111
PR: https://src.fedoraproject.org/rpms/python-cffi/pull-request/14
Fix merged but not build in Fedora because of bz2046865.
FEDORA-2022-a41682259c has been submitted as an update to Fedora 37. https://bodhi.fedoraproject.org/updates/FEDORA-2022-a41682259c
FEDORA-2022-a41682259c has been pushed to the Fedora 37 stable repository. If problem still persists, please make note of it in this bug report.
Ignore me, wrong bugzilla.