Note: This is a public test instance of Red Hat Bugzilla. The data contained within is a snapshot of the live data so any changes you make will not be reflected in the production Bugzilla. Email is disabled so feel free to test any aspect of the site that you want. File any problems you find or give feedback at bugzilla.redhat.com.
Bug 1926822 - python-trio fails to build with Python 3.10: TypeError: traceback_exception_init() got an unexpected keyword argument 'compact'
Summary: python-trio fails to build with Python 3.10: TypeError: traceback_exception_...
Keywords:
Status: CLOSED RAWHIDE
Alias: None
Product: Fedora
Classification: Fedora
Component: python-trio
Version: rawhide
Hardware: Unspecified
OS: Unspecified
unspecified
high
Target Milestone: ---
Assignee: Carl George 🤠
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
Depends On:
Blocks: PYTHON3.10 1927695 1927696 1927699
TreeView+ depends on / blocked
 
Reported: 2021-02-09 14:18 UTC by Miro Hrončok
Modified: 2021-06-14 10:36 UTC (History)
6 users (show)

Fixed In Version:
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed: 2021-06-14 10:36:53 UTC
Type: Bug
Embargoed:


Attachments (Terms of Use)
WIP patch for Python3.10 (deleted)
2021-03-25 15:48 UTC, Tomáš Hrnčiar
no flags Details


Links
System ID Private Priority Status Summary Last Updated
Github python-trio trio issues 1899 0 None open Incompatibility with Python 3.10 2021-02-11 12:50:46 UTC
Github python-trio trio pull 1921 0 None open Test against 3.10 alpha 2021-03-25 15:48:46 UTC

Description Miro Hrončok 2021-02-09 14:18:03 UTC
python-trio fails to build with Python 3.10.0a5.

Error in sys.excepthook:
Traceback (most recent call last):
  File "/builddir/build/BUILD/trio-0.16.0/trio/_core/_multierror.py", line 434, in trio_excepthook
    for chunk in traceback.format_exception(etype, value, tb):
  File "/usr/lib64/python3.10/traceback.py", line 129, in format_exception
    te = TracebackException(type(value), value, tb, limit=limit, compact=True)
TypeError: traceback_exception_init() got an unexpected keyword argument 'compact'

Original exception was:
Traceback (most recent call last):
  File "/usr/lib/python3.10/site-packages/_pytest/main.py", line 269, in wrap_session
    session.exitstatus = doit(config, session) or 0
  File "/usr/lib/python3.10/site-packages/_pytest/main.py", line 323, in _main
    config.hook.pytest_runtestloop(session=session)
  File "/usr/lib/python3.10/site-packages/pluggy/hooks.py", line 286, in __call__
    return self._hookexec(self, self.get_hookimpls(), kwargs)
  File "/usr/lib/python3.10/site-packages/pluggy/manager.py", line 93, in _hookexec
    return self._inner_hookexec(hook, methods, kwargs)
  File "/usr/lib/python3.10/site-packages/pluggy/manager.py", line 84, in <lambda>
    self._inner_hookexec = lambda hook, methods, kwargs: hook.multicall(
  File "/usr/lib/python3.10/site-packages/pluggy/callers.py", line 208, in _multicall
    return outcome.get_result()
  File "/usr/lib/python3.10/site-packages/pluggy/callers.py", line 80, in get_result
    raise ex[1].with_traceback(ex[2])
  File "/usr/lib/python3.10/site-packages/pluggy/callers.py", line 187, in _multicall
    res = hook_impl.function(*args)
  File "/usr/lib/python3.10/site-packages/_pytest/main.py", line 348, in pytest_runtestloop
    item.config.hook.pytest_runtest_protocol(item=item, nextitem=nextitem)
  File "/usr/lib/python3.10/site-packages/pluggy/hooks.py", line 286, in __call__
    return self._hookexec(self, self.get_hookimpls(), kwargs)
  File "/usr/lib/python3.10/site-packages/pluggy/manager.py", line 93, in _hookexec
    return self._inner_hookexec(hook, methods, kwargs)
  File "/usr/lib/python3.10/site-packages/pluggy/manager.py", line 84, in <lambda>
    self._inner_hookexec = lambda hook, methods, kwargs: hook.multicall(
  File "/usr/lib/python3.10/site-packages/pluggy/callers.py", line 208, in _multicall
    return outcome.get_result()
  File "/usr/lib/python3.10/site-packages/pluggy/callers.py", line 80, in get_result
    raise ex[1].with_traceback(ex[2])
  File "/usr/lib/python3.10/site-packages/pluggy/callers.py", line 187, in _multicall
    res = hook_impl.function(*args)
  File "/usr/lib/python3.10/site-packages/_pytest/runner.py", line 109, in pytest_runtest_protocol
    runtestprotocol(item, nextitem=nextitem)
  File "/usr/lib/python3.10/site-packages/_pytest/runner.py", line 126, in runtestprotocol
    reports.append(call_and_report(item, "call", log))
  File "/usr/lib/python3.10/site-packages/_pytest/runner.py", line 217, in call_and_report
    report: TestReport = hook.pytest_runtest_makereport(item=item, call=call)
  File "/usr/lib/python3.10/site-packages/pluggy/hooks.py", line 286, in __call__
    return self._hookexec(self, self.get_hookimpls(), kwargs)
  File "/usr/lib/python3.10/site-packages/pluggy/manager.py", line 93, in _hookexec
    return self._inner_hookexec(hook, methods, kwargs)
  File "/usr/lib/python3.10/site-packages/pluggy/manager.py", line 84, in <lambda>
    self._inner_hookexec = lambda hook, methods, kwargs: hook.multicall(
  File "/usr/lib/python3.10/site-packages/pluggy/callers.py", line 203, in _multicall
    gen.send(outcome)
  File "/usr/lib/python3.10/site-packages/_pytest/skipping.py", line 272, in pytest_runtest_makereport
    rep = outcome.get_result()
  File "/usr/lib/python3.10/site-packages/pluggy/callers.py", line 80, in get_result
    raise ex[1].with_traceback(ex[2])
  File "/usr/lib/python3.10/site-packages/pluggy/callers.py", line 187, in _multicall
    res = hook_impl.function(*args)
  File "/usr/lib/python3.10/site-packages/_pytest/runner.py", line 337, in pytest_runtest_makereport
    return TestReport.from_item_and_call(item, call)
  File "/usr/lib/python3.10/site-packages/_pytest/reports.py", line 322, in from_item_and_call
    longrepr = item.repr_failure(excinfo)
  File "/usr/lib/python3.10/site-packages/_pytest/python.py", line 1677, in repr_failure
    return self._repr_failure_py(excinfo, style=style)
  File "/usr/lib/python3.10/site-packages/_pytest/nodes.py", line 398, in _repr_failure_py
    return excinfo.getrepr(
  File "/usr/lib/python3.10/site-packages/_pytest/_code/code.py", line 648, in getrepr
    return fmt.repr_excinfo(self)
  File "/usr/lib/python3.10/site-packages/_pytest/_code/code.py", line 905, in repr_excinfo
    reprtraceback = self.repr_traceback(excinfo_)
  File "/usr/lib/python3.10/site-packages/_pytest/_code/code.py", line 846, in repr_traceback
    reprentry = self.repr_traceback_entry(entry, einfo)
  File "/usr/lib/python3.10/site-packages/_pytest/_code/code.py", line 798, in repr_traceback_entry
    s = self.get_source(source, line_index, excinfo, short=short)
  File "/usr/lib/python3.10/site-packages/_pytest/_code/code.py", line 736, in get_source
    lines.extend(self.get_exconly(excinfo, indent=indent, markall=True))
  File "/usr/lib/python3.10/site-packages/_pytest/_code/code.py", line 748, in get_exconly
    exlines = excinfo.exconly(tryshort=True).split("\n")
  File "/usr/lib/python3.10/site-packages/_pytest/_code/code.py", line 567, in exconly
    lines = format_exception_only(self.type, self.value)
  File "/usr/lib64/python3.10/traceback.py", line 149, in format_exception_only
    te = TracebackException(type(value), value, None, compact=True)
TypeError: traceback_exception_init() got an unexpected keyword argument 'compact'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/usr/bin/pytest", line 33, in <module>
    sys.exit(load_entry_point('pytest==6.2.2', 'console_scripts', 'pytest')())
  File "/usr/lib/python3.10/site-packages/_pytest/config/__init__.py", line 185, in console_main
    code = main()
  File "/usr/lib/python3.10/site-packages/_pytest/config/__init__.py", line 162, in main
    ret: Union[ExitCode, int] = config.hook.pytest_cmdline_main(
  File "/usr/lib/python3.10/site-packages/pluggy/hooks.py", line 286, in __call__
    return self._hookexec(self, self.get_hookimpls(), kwargs)
  File "/usr/lib/python3.10/site-packages/pluggy/manager.py", line 93, in _hookexec
    return self._inner_hookexec(hook, methods, kwargs)
  File "/usr/lib/python3.10/site-packages/pluggy/manager.py", line 84, in <lambda>
    self._inner_hookexec = lambda hook, methods, kwargs: hook.multicall(
  File "/usr/lib/python3.10/site-packages/pluggy/callers.py", line 208, in _multicall
    return outcome.get_result()
  File "/usr/lib/python3.10/site-packages/pluggy/callers.py", line 80, in get_result
    raise ex[1].with_traceback(ex[2])
  File "/usr/lib/python3.10/site-packages/pluggy/callers.py", line 187, in _multicall
    res = hook_impl.function(*args)
  File "/usr/lib/python3.10/site-packages/_pytest/main.py", line 316, in pytest_cmdline_main
    return wrap_session(config, _main)
  File "/usr/lib/python3.10/site-packages/_pytest/main.py", line 289, in wrap_session
    config.notify_exception(excinfo, config.option)
  File "/usr/lib/python3.10/site-packages/_pytest/config/__init__.py", line 1034, in notify_exception
    excrepr = excinfo.getrepr(
  File "/usr/lib/python3.10/site-packages/_pytest/_code/code.py", line 632, in getrepr
    traceback.format_exception(
  File "/usr/lib64/python3.10/traceback.py", line 129, in format_exception
    te = TracebackException(type(value), value, tb, limit=limit, compact=True)
TypeError: traceback_exception_init() got an unexpected keyword argument 'compact'


In Python 3.10.0a5, TracebackException now has this keyword argument but traceback_exception_init from trio cannot process it.

From https://docs.python.org/3.10/whatsnew/changelog.html

bpo-42877: Added the compact parameter to the constructor of traceback.TracebackException to reduce time and memory for use cases that only need to call TracebackException.format() and TracebackException.format_exception_only().

https://bugs.python.org/issue42877



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

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

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 16:09:16 UTC
This bug appears to have been reported against 'rawhide' during the Fedora 34 development cycle.
Changing version to 34.

Comment 2 Miro Hrončok 2021-02-11 11:39:29 UTC
Adjusting the severity based on affected packages.

Comment 3 Lumír Balhar 2021-02-11 12:25:31 UTC
Submitted upstream: https://github.com/python-trio/trio/issues/1899

Comment 4 Tomáš Hrnčiar 2021-03-25 15:48:07 UTC
Created attachment 1766351 [details]
WIP patch for Python3.10

Upstream has WIP PR to make trio compatible with Python 3.10. It's not yet finished but the current state is enough for our COPR to unblock other packages. If you want to test this locally, my spec file adjustments are in the attached file.

Comment 5 Miro Hrončok 2021-06-04 20:13:54 UTC
This is a mass-posted update. Sorry if it is not 100% accurate to this bugzilla.


The Python 3.10 rebuild is in progress in a Koji side tag. If you manage to fix the problem, please commit the fix in the rawhide branch, but don't build the package in regular rawhide.

You can either build the package in the side tag, with:

    $ fedpkg build --target=f35-python

Or you can the build and we will eventually build it for you.

Note that the rebuild is still in progress, so not all (build) dependencies of this package might be available right away.

Thanks.

See also https://fedoraproject.org/wiki/Changes/Python3.10

If you have general questions about the rebuild, please use this mailing list thread: https://lists.fedoraproject.org/archives/list/devel@lists.fedoraproject.org/thread/G47SGOYIQLRDTWGOSLSWERZSSHXDEDH5/

Comment 6 Miro Hrončok 2021-06-07 22:58:37 UTC
The f35-python side tag has been merged to Rawhide. From now on, build as you would normally build.

Comment 7 Miro Hrončok 2021-06-14 10:36:53 UTC
This package was successfully rebuilt with Python 3.10.

If you need this bugzilla open for tracking purposes, sorry for the automatic closing: feel free to reopen it.


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