-
Notifications
You must be signed in to change notification settings - Fork 63
Open
Description
The function is declared as accepting a single Python int
wasmtime-py/wasmtime/_value.py
Lines 28 to 29 in 170aca9
| def _unintern(val: int) -> typing.Any: | |
| return Val._id_to_extern.get(val) |
However in both call sites ctypes._Pointer[Any] is supplied
wasmtime-py/wasmtime/_store.py
Lines 43 to 45 in 170aca9
| data = ffi.wasmtime_context_get_data(self._context()) | |
| if data: | |
| return value._unintern(data) |
wasmtime-py/wasmtime/_value.py
Lines 181 to 182 in 170aca9
| extern_id = wasmtime_externref_data(store._context(), raw.of.externref) | |
| val = _unintern(extern_id) |
this was uncovered during investigation of #302 on a branch derived from the nox branch for #301. I believe it is not currently detected due to several cases of from ... import *. This issue is probably not a high priority or severity, I'm mainly recording it as a reminder to myself.
➜ wasmtime-py git:(nox) ✗ nox -p 3.14
nox > Running session tests-3.14
nox > Creating virtual environment (uv) using python3.14 in .nox/tests-3-14
nox > /Users/alex/.local/share/uv/tools/nox/bin/uv pip install '.[testing]'
nox > coverage run -m pytest
================================================ test session starts =================================================
platform darwin -- Python 3.14.0, pytest-8.4.2, pluggy-1.6.0
rootdir: /Users/alex/src/wasmtime-py
configfile: pytest.ini
plugins: mypy-1.0.1
collected 258 items
ci/build-rust.py .F [ 0%]
ci/cbindgen.py . [ 1%]
...
wasmtime/loader.py . [100%]
====================================================== FAILURES ======================================================
____________________________________________________ test session ____________________________________________________
mypy exited with status 1.
_____________________________________________ [mypy] wasmtime/_store.py ______________________________________________
46: error: Argument 1 to "_unintern" has incompatible type "_Pointer[Any]"; expected "int" [arg-type]
_____________________________________________ [mypy] wasmtime/_value.py ______________________________________________
184: error: Argument 1 to "_unintern" has incompatible type "_Pointer[Any]"; expected "int" [arg-type]
======================================================== mypy ========================================================
Found 2 errors in 2 files (checked 154 source files)
============================================== short test summary info ===============================================
FAILED ci/build-rust.py::mypy-status
FAILED wasmtime/_store.py::mypy
FAILED wasmtime/_value.py::mypy
=========================================== 3 failed, 255 passed in 17.63s ===========================================
nox > Command coverage run -m pytest failed with exit code 1
nox > Session tests-3.14 failed.Metadata
Metadata
Assignees
Labels
No labels