-
Notifications
You must be signed in to change notification settings - Fork 2.2k
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
[BUG] 🐍 3.10-dev (ubuntu, mac, ~windows): TypeError: 'str' object is not callable #2774
Comments
Already spotted this in #2768 as well, but haven't had time to look closer. We might not want to wait until 3.10 is released to report this (ahem we'd never let such a thing happen cough) ;-) |
Before looking at the code, this looked like something is being passed through as a type annotation and being called, but now type annotations are all strings, so it's now calling a string instead of a callable. But have no clue where anything like that would be in our code. It seems to possibly be happening when a module is being reloaded? That could be an issue somewhere in Python's stdlib code. I think 3.10a4 is the first with " |
We don't run these tests on Windows after 3.7 due to the DLL loading changes which we've never worked around, IIRC. So it's likely a problem everywhere. |
Er, I understood your prior post, but I'm not sure how Windows 3.7 w/ DLL relates to 3.10-dev - can you expand on that? |
Oh - meaning I should remove the |
In 3.8+ loading DLLs on Winblows changes in this way ( https://docs.python.org/3/whatsnew/3.8.html#changes-in-the-python-api Here's @henryiii tried to fix this for pybind11, but with no success. |
That would mean this would be reproducible on python 3.9.1 with |
I just tried, but I can't reproduce locally with the last version of Python. I installed "Python 3.10.0a4+ (heads/master:d16f617, Jan 9 2021, 20:40:43)" through pyenv, and all tests pass. I'll give the exact same version, 3.10.0a4, a try as well. |
Scratch that. It's the embedding tests that fail. If you run those, CPython's |
I suspect it's loading a file somewhere in Python, not our .py's. We don't use annotations, sadly, much less try to call them. |
Is there some way to get more information about where the failure actually is, perhaps? If we just had a filename, that would be huge. We need |
Seems like something worse is going on, though, I'm afraid. If I comment out preceding tests in
|
gdb backtrace for the interested (only just started investigating)
Follow-up: Oh joy. Adding these two lines to the start of py::finalize_interpreter();
py::initialize_interpreter(); |
Minimal reproducer:
This looks like fun. |
CPython-only reproducer: #include <Python.h>
int main() {
Py_InitializeEx(1);
Py_Finalize();
Py_InitializeEx(1);
PyRun_SimpleString("class Widget: pass\n"
"class DerivedWidget(Widget):\n"
" def __init__(self):\n"
" super().__init__()\n");
Py_Finalize();
printf("Works\n");
return 0;
} If anyone's bored, mind trying this out? |
Bisected Python to show the error probably got introduced here: python/cpython#20058. I guess I'll make a bug report; this doesn't seem like obvious code to debug... |
Reported here: https://bugs.python.org/issue42882 |
Should already be fixed by python/cpython#24193 :-) Hopefully we can soon try this out. |
Merged into CPython's master. https://www.python.org/dev/peps/pep-0619/ says a new alpha is expected around "2021-02-01". That's pretty long, though. How do we best "fix" CI, until then? |
Isn't |
I don't think so. If I read things correctly on https://github.com/actions/setup-python, it's only using releases? (cfr. also https://github.com/actions/setup-python/blob/66319ca9fa6c19287a320c27bd980953e731b827/src/find-python.ts#L157) |
3.10-dev is the last pre-release, so 3.10.0a4. Should we disable this check till 3.10.0a5? |
I'd be up for that, as long as we can somehow get a reminder that 3.10.0a5 is out? |
Alternatively, temporarily switch to nightly builds, so we can catch things earlier, before alpha releases? Can pyenv install the latest On Linux, we can use deadsnakes, though. I think that one has nightly builds pre-built? See #2746. |
Maybe, but it took a while to support 3.9 after the release, so I kind of doubt it. It's also slow.
Yes, we could do that. |
Seen this crop up in my PR and another:
Example PRs:
Guessing it's just a minor thing that'll blow over. I guess we can close this if we don't see it reoccur?
FYI @henryiii @YannickJadoul
The text was updated successfully, but these errors were encountered: