GeezerVisonThe World Wide Web, restored to 800 pixels of glory. | |||||||||||||||||||||||
| Home|About|Gaming cabinet|Archives|How it works|Starter sites | |||||||||||||||||||||||
GeezerVison is showing github.com — Don't require `_testcapi` and `_testinternalcapi` for `test_monitoring.py` by ShaharNaveh · Pull Request #152311 · python/cpython Conversation
ShaharNaveh
force-pushed
the
testcapi-monitoring
branch
3 times, most recently
from
261c9bd to
2f281f9
Compare
ShaharNaveh
force-pushed
the
testcapi-monitoring
branch
from
2f281f9 to
d043654
Compare
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 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.
Sorry, something went wrong. Uh oh!
There was an error while loading. Please reload this page. All reactions
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This'll be executed at import time, so it will skip
Sorry, something went wrong. Uh oh!
There was an error while loading. Please reload this page. All reactions
|
There was an error while loading. Please reload this page.
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 findingsimport ast import pathlib ROOT = pathlib.Path(__file__).parent TEST_DIR = ROOT / "Lib/test" class Visitor(ast.NodeVisitor): def __init__(self): self.found = False def visit_Call(self, node): func = node.func if not isinstance(func, ast.Attribute): return if func.attr != "import_module": return args = node.args if len(args) != 1: return arg = args[0] if not isinstance(arg, ast.Constant): return value = arg.value self.found = value in ("_testcapi", "_testinternalcapi") def visit_ClassDef(self, node): for bnode in node.body: if isinstance(bnode, ast.Assign): return self.generic_visit(bnode) def visit_FuncionDef(self, node): return def visit_AsyncFunctionDef(self, node): return bad = set() for child in TEST_DIR.glob("**/*.py"): if "test_capi" in child.parts: continue rchild = child.relative_to(ROOT) try: source = child.read_text(encoding="utf-8") mod = ast.parse(source) except: bad.add(rchild) continue visitor = Visitor() visitor.visit(mod) if visitor.found: print(rchild) # print("\ncould not parse:\n" + "\n".join(map(str, bad))) |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
|
Interestingly this uncovers UB in |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
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 |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
See the "Display logs" step, which has the UBSan output. |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
|
Seems like #152376 fixed it. tysm for looking into it! |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
LGTM, thanks.
Sorry, something went wrong.
There was an error while loading. Please reload this page.
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. |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
|
GH-152660 is a backport of this pull request to the 3.15 branch. |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
|
GH-152661 is a backport of this pull request to the 3.14 branch. |
Sorry, something went wrong.
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.13. |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
|
Sorry, @ShaharNaveh and @StanFromIreland, I could not cleanly backport this to |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
|
Skipping backport to 3.13 here. |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
…oring.py` (GH-152311) (#152660) (cherry picked from commit 189ab83) Co-authored-by: Shahar Naveh <[email protected]> Co-authored-by: Stan Ulbrych <[email protected]>
…oring.py` (GH-152311) (#152661) (cherry picked from commit 189ab83) Co-authored-by: Shahar Naveh <[email protected]> Co-authored-by: Stan Ulbrych <[email protected]>
* 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) ...
There was an error while loading. Please reload this page.
Successfully merging this pull request may close these issues.
There was an error while loading. Please reload this page.