Description
Hey team ! First of all, happy new year, and thanks for your great work !
Crash Report
When running stubgen
on a compiled python module using boost::python, stubgen crashes.
See below for a minimal reproducible example.
Traceback
Traceback (most recent call last):
File "/install/bin/stubgen", line 8, in <module>
sys.exit(main())
File "mypy/stubgen.py", line 1564, in main
File "mypy/stubgen.py", line 1457, in generate_stubs
File "mypy/stubgenc.py", line 64, in generate_stub_for_c_module
File "mypy/stubgenc.py", line 293, in generate_c_type_stub
File "mypy/stubgenc.py", line 164, in generate_c_function_stub
TypeError: str object expected; got None
To Reproduce
I was able to break down a minimal example that breaks (thanks to TNG/boost_python_examples ). You find in the archive a sample C++ file and a basic CMakeLists to compile it
After extracting both files into a folder, build the library (requires python and libboost-python-dev)
mkdir build && cd build
cmake ..
make
Run stubgen on the generated lib
, sh
stubgen -p example_pywrap --search-path .
...and it crashes
Your Environment
- Mypy version used: 0.790
- Stubgen command-line flags:
- Mypy configuration options from
mypy.ini
(and other config files): None - Python version used: 3.8
- Operating system and version: Ubuntu 20.04
Remarks
This closely looks like the bug fixed in #8888. And indeed, if I install the mypy build mentionned in this PR, the problem is fixed. (see this message: #8888 (comment))
- stubgen does not crash
- the output file
out/example_pywrap.pyi
exists and contains valid content
What I don't understand is that the PR has been merged 6 months ago, the resulting commit seems to be in the 0.790 tag (see commit ea9291d), so I should not see the crash on mypy 0.790, shoud I ?
[EDIT] I tested again with the latest master commit of this repo (mypy-0.800+dev.5f5d90eee23b809185145f6da7b18a3ca41b4879
) and it works (no crashes). So:
- If the crash was indeed fixed by Fix type expected by stubgenc #8888, can someone explain me why it was not in v0.790 even if the commit view mentions it ?
- Otherwise, I faced a different bug that was fixed after v0.790.
Either way, is there somewhere I can go to see the ETA for 0.800, so I can know if I need how long my work-around is supposed to hold.