-
-
Notifications
You must be signed in to change notification settings - Fork 2.9k
[stubgen] Crash on boost::python C extension #9888
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
Comments
Fixes python#9888 I applied the following patch to typeshed and ran self check: ``` +@overload +def getattr(__o: Any, name: str, __default: None) -> Optional[Any]: ... +@overload def getattr(__o: Any, name: str, __default: Any = ...) -> Any: ... ```
Thanks for the report, opened #9889 to fix this. The thing that's causing confusion for you is that the TypeError is raised by mypyc and so doesn't manifest if you don't compile mypy with mypyc, e.g. most ways of using latest master / installing from git. |
Thanks for the fix 👍 and for the explanation, I did not know mypy had its own compiler, that's impressive. I'll wait for this to land in the next release, and use a non-compiled version in the meantime |
Uh oh!
There was an error while loading. Please reload this page.
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
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
example.tar.gz
After extracting both files into a folder, build the library (requires python and libboost-python-dev)
Run stubgen on the generated lib
, sh
stubgen -p example_pywrap --search-path .
...and it crashes
Your Environment
mypy.ini
(and other config files): NoneRemarks
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))
out/example_pywrap.pyi
exists and contains valid contentWhat 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: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.
The text was updated successfully, but these errors were encountered: