You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I simplified as much as possible to have minimum reproduction code.
It's caused by the extra parameter pass in subclass definition, I'm not sure which python language construct this is and when it was added. But stubgen goes out on it.
Traceback (most recent call last):
File "/Users/bram/.pyenv/versions/3.12.1/bin/stubgen", line 8, in <module>
sys.exit(main())
^^^^^^
File "mypy/stubgen.py", line 1895, in main
generate_stubs(options)
File "mypy/stubgen.py", line 1703, in generate_stubs
generate_stub_for_py_module(
File "mypy/stubgen.py", line 1673, in generate_stub_for_py_module
mod.ast.accept(gen)
File "mypy/nodes.py", line 372, in accept
return visitor.visit_mypy_file(self)
File "mypy/stubgen.py", line 466, in visit_mypy_file
super().visit_mypy_file(o)
File "mypy/traverser.py", line 116, in visit_mypy_file
d.accept(self)
File "mypy/nodes.py", line 1183, in accept
return visitor.visit_class_def(self)
File "mypy/stubgen.py", line 729, in visit_class_def
base_types = self.get_base_types(o)
File "mypy/stubgen.py", line 807, in get_base_types
base_types.append(f"{name}={value.accept(p)}")
TypeError: str object expected; got None
Your Environment
Mypy version used: 1.11
Python version used: 3.12
The text was updated successfully, but these errors were encountered:
This only happens on compiled version of mypy, because value.accept(AliasPrinter()) returns None which breaks mypyc's expectation to receive a str instance for fstring formatting.
Looks like AliasPrinter should be extended to support literals.
Bug Report
stub generation for Home Assistant is broken.
To Reproduce
Stubgen fails on this file:
https://github.com/home-assistant/core/blob/dev/homeassistant/components/recorder/migration.py
This commit, which I found using
git bisect
home-assistant/core@a22e12d
I simplified as much as possible to have minimum reproduction code.
It's caused by the extra parameter pass in subclass definition, I'm not sure which python language construct this is and when it was added. But stubgen goes out on it.
Reproduction code:
Expected Behavior
Stubs are correctly generated without an error.
Actual Behavior
Your Environment
The text was updated successfully, but these errors were encountered: