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
[C API] Add tests on Py_FrozenMain() #88297
Comments
I would like to change Py_FrozenMain() using the new PyConfig C API, but I would prefer to first write tests of its current behavior. Currently, Py_FrozenMain() has no test. Py_FrozenMain() is used by Tools/freeze/freeze.py. Old freeze.py issues:
I never used freeze.py, but since we get bug reports, it seems like it's used by users :-) Note: freeze.py has no test neither. Py_FrozenMain() has been modified recently in bpo-44113: commit 7565586
See also: [capi-sig] Py_FrozenMain and the stable ABI See also: [Python-Dev] What's the story on Py_FrozenMain? |
commit eaede0d
|
Compilation failed on s390x RHEL7 LTO + PGO 3.x buildbot: (...) make[3]: *** [python] Error 1 gcc -pthread -flto -fuse-linker-plugin -ffat-lto-objects -flto-partition=none -g -fprofile-generate -Xlinker -export-dynamic -o python Programs/python.o libpython3.11.a -lcrypt -lpthread -ldl -lutil -lm -lm make[4]: Leaving directory |
The tests are now skipped on Windows. It might be better to use a feature check: hasattr(ctypes.pythonapi, 'Py_FrozenMain') IMO, Py_FrozenMain is quite specific: it's OK if it's exported, but also OK if it's missing. (Unless you're compiling a special build with frozen modules, which won't work at all without Py_FrozenMain.) |
On Unix, _testembed gets the symbol since it's used. Currently, hasattr(ctypes.pythonapi, 'Py_FrozenMain') returns false if Python is built without --enable-shared, even if _testembed is able to get Py_FrozenMain(). I hope that bpo-44133 will be solved soon. |
commit eaede0d
commit 58a9939
|
I marked bpo-36940 as a duplicate of this issue. |
Note: these values reflect the state of the issue at the time it was migrated and might not reflect the current state.
Show more details
GitHub fields:
bugs.python.org fields:
The text was updated successfully, but these errors were encountered: