Uh oh!
There was an error while loading. Please reload this page.
Don't require _testcapi and _testinternalcapi for test_monitoring.py - #152311
Conversation
261c9bd to
2f281f9Compare2f281f9 to
d043654Compare
StanFromIreland
left a comment
There was a problem hiding this comment.
Do you know if there any more tests with the same issues (I'm not familiar with RustPython, so I don't know where to even try finding a list)? I'd rather get them all done in one go.
| class TestCApiEventGeneration(MonitoringTestBase, unittest.TestCase): | ||
| _testcapi = import_helper.import_module("_testcapi") |
There was a problem hiding this comment.
This'll be executed at import time, so it will skip test_monitoring defeating the whole point of this PR. You can move it to a setUpClass.
We are copying the tests from CPython directly into Lib/test, this structure might look familiar:) Anyway, I've gathered a list using a small script:
I've looked at each of those tests, all but Script used for findingsimportastimportpathlibROOT=pathlib.Path(__file__).parentTEST_DIR=ROOT/"Lib/test"classVisitor(ast.NodeVisitor):
def__init__(self):
self.found=Falsedefvisit_Call(self, node):
func=node.funcifnotisinstance(func, ast.Attribute):
returniffunc.attr!="import_module":
returnargs=node.argsiflen(args) !=1:
returnarg=args[0]
ifnotisinstance(arg, ast.Constant):
returnvalue=arg.valueself.found=valuein ("_testcapi", "_testinternalcapi")
defvisit_ClassDef(self, node):
forbnodeinnode.body:
ifisinstance(bnode, ast.Assign):
returnself.generic_visit(bnode)
defvisit_FuncionDef(self, node):
returndefvisit_AsyncFunctionDef(self, node):
returnbad=set()
forchildinTEST_DIR.glob("**/*.py"):
if"test_capi"inchild.parts:
continuerchild=child.relative_to(ROOT)
try:
source=child.read_text(encoding="utf-8")
mod=ast.parse(source)
except:
bad.add(rchild)
continuevisitor=Visitor()
visitor.visit(mod)
ifvisitor.found:
print(rchild)
# print("\ncould not parse:\n" + "\n".join(map(str, bad))) |
StanFromIreland
commented
Jun 27, 2026
Interestingly this uncovers UB in |
ShaharNaveh
commented
Jun 27, 2026
I see that it just crashes without any information:/ Anway, I've subscribed to #152376 so I'll update the PR once it's merged. puting on draft for now |
StanFromIreland
commented
Jun 27, 2026
See the "Display logs" step, which has the UBSan output. |
Seems like #152376 fixed it. tysm for looking into it! |
Uh oh!
There was an error while loading. Please reload this page.
Thanks @ShaharNaveh for the PR, and @StanFromIreland for merging it 🌮🎉.. I'm working now to backport this PR to: 3.14, 3.15. |
GH-152660 is a backport of this pull request to the 3.15 branch. |
GH-152661 is a backport of this pull request to the 3.14 branch. |
Thanks @ShaharNaveh for the PR, and @StanFromIreland for merging it 🌮🎉.. I'm working now to backport this PR to: 3.13. |
Sorry, @ShaharNaveh and @StanFromIreland, I could not cleanly backport this to |
StanFromIreland
commented
Jun 30, 2026
Skipping backport to 3.13 here. |
* main: (266 commits) pythongh-151626: Fix tests that fail when PYTHONPYCACHEPREFIX is set (pythonGH-151952) pythongh-152728: IDLE - move 3 toplevel fix_xyz functions to idlelb.util (python#152729) pythongh-152711: Add pythoninfo-build command to Platforms/Android (python#152713) pythongh-152715: Add pythoninfo-build command to Platforms/Apple (python#152716) pythongh-152433: Windows: enable mmapmodule for UWP (python#152473) pythongh-152433: Windows: use GetFileSizeEx instead of GetFileSize for memory mapped files (python#152383) pythonGH-81881: Raise `SpecialFileError` for sockets and devices in `shutil.copyfile` (python#142693) pythongh-152502: Detect the curses mouse interface and is_* methods portably (pythonGH-152705) pythongh-145857: Replace `DELETE_GLOBAL` with `PUSH_NULL; STORE_GLOBAL` (pythonGH-146314) pythongh-145854: Replace `DELETE_NAME` with `PUSH_NULL; STORE_NAME` (pythonGH-146006) pythongh-152680: Detect container/VM in test.pythoninfo (python#152668) pythongh-152682: Fix NULL dereference on OOM in `symtable_visit_type_param_bound_or_default` (python#152684) pythongh-151881: Skip tk_inactive negativity check on Windows (pythonGH-152683) pythongh-152546: Refactor `mappingproxy.__new__` to use `PyDictProxy_New` (python#152547) pythongh-151126: Fix a possible crash during the startup with no memory under `Py_STACKREF_DEBUG` (python#152478) pythongh-152635: Raise MemoryError when the lock allocation fails in `_interpchannels.create()` (python#152642) pythongh-151029: Fix `test_remote_exec_deleted_static_executable` on static installed builds (pythonGH-152653) pythongh-121249: Deprecate using F/D type codes in the struct module (python#152309) pythongh-152192: Fix JUMP_BACKWARD passing a truncated oparg to the jit tracer (pythonGH-152382) Don't require the `_test{internal}capi` modules in `test_monitoring.py` (python#152311) ...
same as #152171 and #152185