Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Python 3.11: traceback_exception_init() has new keyword arguments #2270

Merged
merged 4 commits into from
May 15, 2022

Commits on Mar 24, 2022

  1. Python 3.11: traceback_exception_init() has new keyword arguments

    This avoids:
    
        ============================= test session starts ==============================
        platform linux -- Python 3.11.0a6, pytest-7.1.1, pluggy-1.0.0
        rootdir: .../trio, configfile: pyproject.toml
        collected 213 items
    
        trio/_core/tests/test_asyncgen.py .
        INTERNALERROR> Traceback (most recent call last):
        INTERNALERROR>   File ".../trio/__venv__/lib64/python3.11/site-packages/_pytest/main.py", line 268, in wrap_session
        INTERNALERROR>     session.exitstatus = doit(config, session) or 0
        INTERNALERROR>                          ^^^^^^^^^^^^^^^^^^^^^
        INTERNALERROR>   File ".../trio/__venv__/lib64/python3.11/site-packages/_pytest/main.py", line 322, in _main
        INTERNALERROR>     config.hook.pytest_runtestloop(session=session)
        INTERNALERROR>     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
        INTERNALERROR>   File ".../trio/__venv__/lib64/python3.11/site-packages/pluggy/_hooks.py", line 265, in __call__
        INTERNALERROR>     return self._hookexec(self.name, self.get_hookimpls(), kwargs, firstresult)
        INTERNALERROR>            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
        INTERNALERROR>   File ".../trio/__venv__/lib64/python3.11/site-packages/pluggy/_manager.py", line 80, in _hookexec
        INTERNALERROR>     return self._inner_hookexec(hook_name, methods, kwargs, firstresult)
        INTERNALERROR>            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
        INTERNALERROR>   File ".../trio/__venv__/lib64/python3.11/site-packages/pluggy/_callers.py", line 60, in _multicall
        INTERNALERROR>     return outcome.get_result()
        INTERNALERROR>            ^^^^^^^^^^^^^^^^^^^^
        INTERNALERROR>   File ".../trio/__venv__/lib64/python3.11/site-packages/pluggy/_result.py", line 60, in get_result
        INTERNALERROR>     raise ex[1].with_traceback(ex[2])
        INTERNALERROR>     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
        INTERNALERROR>   File ".../trio/__venv__/lib64/python3.11/site-packages/pluggy/_callers.py", line 39, in _multicall
        INTERNALERROR>     res = hook_impl.function(*args)
        INTERNALERROR>           ^^^^^^^^^^^^^^^^^^^^^^^^^
        INTERNALERROR>   File ".../trio/__venv__/lib64/python3.11/site-packages/_pytest/main.py", line 347, in pytest_runtestloop
        INTERNALERROR>     item.config.hook.pytest_runtest_protocol(item=item, nextitem=nextitem)
        INTERNALERROR>     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
        INTERNALERROR>   File ".../trio/__venv__/lib64/python3.11/site-packages/pluggy/_hooks.py", line 265, in __call__
        INTERNALERROR>     return self._hookexec(self.name, self.get_hookimpls(), kwargs, firstresult)
        INTERNALERROR>            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
        INTERNALERROR>   File ".../trio/__venv__/lib64/python3.11/site-packages/pluggy/_manager.py", line 80, in _hookexec
        INTERNALERROR>     return self._inner_hookexec(hook_name, methods, kwargs, firstresult)
        INTERNALERROR>            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
        INTERNALERROR>   File ".../trio/__venv__/lib64/python3.11/site-packages/pluggy/_callers.py", line 60, in _multicall
        INTERNALERROR>     return outcome.get_result()
        INTERNALERROR>            ^^^^^^^^^^^^^^^^^^^^
        INTERNALERROR>   File ".../trio/__venv__/lib64/python3.11/site-packages/pluggy/_result.py", line 60, in get_result
        INTERNALERROR>     raise ex[1].with_traceback(ex[2])
        INTERNALERROR>     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
        INTERNALERROR>   File ".../trio/__venv__/lib64/python3.11/site-packages/pluggy/_callers.py", line 39, in _multicall
        INTERNALERROR>     res = hook_impl.function(*args)
        INTERNALERROR>           ^^^^^^^^^^^^^^^^^^^^^^^^^
        INTERNALERROR>   File ".../trio/__venv__/lib64/python3.11/site-packages/_pytest/runner.py", line 111, in pytest_runtest_protocol
        INTERNALERROR>     runtestprotocol(item, nextitem=nextitem)
        INTERNALERROR>     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
        INTERNALERROR>   File ".../trio/__venv__/lib64/python3.11/site-packages/_pytest/runner.py", line 130, in runtestprotocol
        INTERNALERROR>     reports.append(call_and_report(item, "call", log))
        INTERNALERROR>                    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
        INTERNALERROR>   File ".../trio/__venv__/lib64/python3.11/site-packages/_pytest/runner.py", line 221, in call_and_report
        INTERNALERROR>     report: TestReport = hook.pytest_runtest_makereport(item=item, call=call)
        INTERNALERROR>                          ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
        INTERNALERROR>   File ".../trio/__venv__/lib64/python3.11/site-packages/pluggy/_hooks.py", line 265, in __call__
        INTERNALERROR>     return self._hookexec(self.name, self.get_hookimpls(), kwargs, firstresult)
        INTERNALERROR>            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
        INTERNALERROR>   File ".../trio/__venv__/lib64/python3.11/site-packages/pluggy/_manager.py", line 80, in _hookexec
        INTERNALERROR>     return self._inner_hookexec(hook_name, methods, kwargs, firstresult)
        INTERNALERROR>            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
        INTERNALERROR>   File ".../trio/__venv__/lib64/python3.11/site-packages/pluggy/_callers.py", line 55, in _multicall
        INTERNALERROR>     gen.send(outcome)
        INTERNALERROR>     ^^^^^^^^^^^^^^^^^
        INTERNALERROR>   File ".../trio/__venv__/lib64/python3.11/site-packages/_pytest/skipping.py", line 265, in pytest_runtest_makereport
        INTERNALERROR>     rep = outcome.get_result()
        INTERNALERROR>           ^^^^^^^^^^^^^^^^^^^^
        INTERNALERROR>   File ".../trio/__venv__/lib64/python3.11/site-packages/pluggy/_result.py", line 60, in get_result
        INTERNALERROR>     raise ex[1].with_traceback(ex[2])
        INTERNALERROR>     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
        INTERNALERROR>   File ".../trio/__venv__/lib64/python3.11/site-packages/pluggy/_callers.py", line 39, in _multicall
        INTERNALERROR>     res = hook_impl.function(*args)
        INTERNALERROR>           ^^^^^^^^^^^^^^^^^^^^^^^^^
        INTERNALERROR>   File ".../trio/__venv__/lib64/python3.11/site-packages/_pytest/runner.py", line 365, in pytest_runtest_makereport
        INTERNALERROR>     return TestReport.from_item_and_call(item, call)
        INTERNALERROR>            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
        INTERNALERROR>   File ".../trio/__venv__/lib64/python3.11/site-packages/_pytest/reports.py", line 345, in from_item_and_call
        INTERNALERROR>     longrepr = item.repr_failure(excinfo)
        INTERNALERROR>                ^^^^^^^^^^^^^^^^^^^^^^^^^^
        INTERNALERROR>   File ".../trio/__venv__/lib64/python3.11/site-packages/_pytest/python.py", line 1795, in repr_failure
        INTERNALERROR>     return self._repr_failure_py(excinfo, style=style)
        INTERNALERROR>            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
        INTERNALERROR>   File ".../trio/__venv__/lib64/python3.11/site-packages/_pytest/nodes.py", line 475, in _repr_failure_py
        INTERNALERROR>     return excinfo.getrepr(
        INTERNALERROR>            ^^^^^^^^^^^^^^^^
        INTERNALERROR>   File ".../trio/__venv__/lib64/python3.11/site-packages/_pytest/_code/code.py", line 666, in getrepr
        INTERNALERROR>     return fmt.repr_excinfo(self)
        INTERNALERROR>            ^^^^^^^^^^^^^^^^^^^^^^
        INTERNALERROR>   File ".../trio/__venv__/lib64/python3.11/site-packages/_pytest/_code/code.py", line 926, in repr_excinfo
        INTERNALERROR>     reprtraceback = self.repr_traceback(excinfo_)
        INTERNALERROR>                     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
        INTERNALERROR>   File ".../trio/__venv__/lib64/python3.11/site-packages/_pytest/_code/code.py", line 867, in repr_traceback
        INTERNALERROR>     reprentry = self.repr_traceback_entry(entry, einfo)
        INTERNALERROR>                 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
        INTERNALERROR>   File ".../trio/__venv__/lib64/python3.11/site-packages/_pytest/_code/code.py", line 818, in repr_traceback_entry
        INTERNALERROR>     s = self.get_source(source, line_index, excinfo, short=short)
        INTERNALERROR>         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
        INTERNALERROR>   File ".../trio/__venv__/lib64/python3.11/site-packages/_pytest/_code/code.py", line 756, in get_source
        INTERNALERROR>     lines.extend(self.get_exconly(excinfo, indent=indent, markall=True))
        INTERNALERROR>                  ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
        INTERNALERROR>   File ".../trio/__venv__/lib64/python3.11/site-packages/_pytest/_code/code.py", line 768, in get_exconly
        INTERNALERROR>     exlines = excinfo.exconly(tryshort=True).split("\n")
        INTERNALERROR>               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
        INTERNALERROR>   File ".../trio/__venv__/lib64/python3.11/site-packages/_pytest/_code/code.py", line 585, in exconly
        INTERNALERROR>     lines = format_exception_only(self.type, self.value)
        INTERNALERROR>             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
        INTERNALERROR>   File "/usr/lib64/python3.11/traceback.py", line 159, in format_exception_only
        INTERNALERROR>     te = TracebackException(type(value), value, None, compact=True)
        INTERNALERROR>          ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
        INTERNALERROR>   File ".../trio/trio/_core/_multierror.py", line 393, in traceback_exception_init
        INTERNALERROR>     traceback_exception_original_init(
        INTERNALERROR>     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
        INTERNALERROR>   File "/usr/lib64/python3.11/traceback.py", line 718, in __init__
        INTERNALERROR>     cause = TracebackException(
        INTERNALERROR>             ^^^^^^^^^^^^^^^^^^^
        INTERNALERROR> TypeError: traceback_exception_init() got an unexpected keyword argument 'max_group_width'
    hroncok committed Mar 24, 2022
    Configuration menu
    Copy the full SHA
    033d874 View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    c1ed76a View commit details
    Browse the repository at this point in the history

Commits on May 13, 2022

  1. Configuration menu
    Copy the full SHA
    d49e8ec View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    95af17a View commit details
    Browse the repository at this point in the history