Skip to content

Python 3.10.2 Raise TypeError: typing._GenericAlias.__init__() got multiple values for keyword argument '_typevar_types' #556

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

Closed
robertchang961 opened this issue Mar 26, 2025 · 2 comments · Fixed by #557

Comments

@robertchang961
Copy link

robertchang961 commented Mar 26, 2025

I'm using Robotframework for UI testing and robotidy for autoformatting Robot Framework code with Python 3.10.2.

robotidy --config pyproject.toml --check --diff .

It works in typing_extensions 4.12.2, but raises TypeError: typing._GenericAlias.__init__() got multiple values for keyword argument '_typevar_types' with typing_extensions 4.13.0.

Error msg :

$ robotidy --config pyproject.toml --check --diff .
Traceback (most recent call last):
  File "/builds/robertchang/Regression_Test/.venv/bin/robotidy", line 5, in <module>
    from robotidy.cli import cli
  File "/builds/robertchang/Regression_Test/.venv/lib/python3.10/site-packages/robotidy/cli.py", line 6, in <module>
    import rich_click as click
  File "/builds/robertchang/Regression_Test/.venv/lib/python3.10/site-packages/rich_click/__init__.py", line 75, in <module>
    from rich_click.decorators import command as command
  File "/builds/robertchang/Regression_Test/.venv/lib/python3.10/site-packages/rich_click/decorators.py", line 211, in <module>
    def pass_context(f: Callable[Concatenate[RichContext, P], R]) -> Callable[P, R]:
  File "/usr/local/lib/python3.10/typing.py", line 311, in inner
    return func(*args, **kwds)
  File "/usr/local/lib/python3.10/typing.py", line 402, in __getitem__
    return self._getitem(self, parameters)
  File "/builds/robertchang/Regression_Test/.venv/lib/python3.10/site-packages/typing_extensions.py", line 2[127](https://sauron.qnap.com/robertchang/Regression_Test/-/jobs/1984423#L127), in Concatenate
    return _concatenate_getitem(self, parameters)
  File "/usr/local/lib/python3.10/typing.py", line 311, in inner
    return func(*args, **kwds)
  File "/builds/robertchang/Regression_Test/.venv/lib/python3.10/site-packages/typing_extensions.py", line 2107, in _concatenate_getitem
    return _create_concatenate_alias(self, parameters)
  File "/builds/robertchang/Regression_Test/.venv/lib/python3.10/site-packages/typing_extensions.py", line 2076, in _create_concatenate_alias
    concatenate = _ConcatenateGenericAlias(origin, parameters,
  File "/usr/local/lib/python3.10/typing.py", line 1273, in __init__
    super().__init__(*args, **kwargs,
TypeError: typing._GenericAlias.__init__() got multiple values for keyword argument '_typevar_types'

Installed Packages :

flake8
flake8-html
robotframework==5.0.1
robotframework-lint
robotframework-tidy==4.11.0
Successfully installed MarkupSafe-3.0.2 click-8.1.8 colorama-0.4.6 flake8-7.1.2 flake8-html-0.4.3 jinja2-3.1.6 markdown-it-py-3.0.0 mccabe-0.7.0 mdurl-0.1.2 pathspec-0.12.1 pycodestyle-2.12.1 pyflakes-3.2.0 pygments-2.19.1 rich-13.9.4 rich-click-1.7.4 robotframework-5.0.1 robotframework-lint-1.1 robotframework-tidy-4.11.0 tomli-2.0.2 typing-extensions-4.13.0
@Daraan
Copy link
Contributor

Daraan commented Mar 26, 2025

Thank you for reporting. The fix should be fairly simple by using the new keywords only for 3.10.3+ in which typing._ConcatenateGenericAlias.__init__ was removed. I am on it.

@Daraan
Copy link
Contributor

Daraan commented Mar 26, 2025

@robertchang961 I've added the fix in the linked PR. If you do not want to wait you can fix it manually by:

  • +/- 1 your python version
  • change line 2075 in your typing_extensions source code:
    -if sys.version_info >= (3, 10, 2):
    +if sys.version_info >= (3, 10, 3):

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants