pytest-pyodide icon indicating copy to clipboard operation
pytest-pyodide copied to clipboard

TST: can't pickle pyodide.InternalError

Open rth opened this issue 1 year ago • 4 comments

Now in https://github.com/pyodide/pytest-pyodide/pull/80 (that just updates linting) we start to see the issue about picklability of InternalError. I think this is likely related to changes in pyodide 0.23.0

@hoodmane for JsException that got subclassed into a Python Exception I guess we don't support for them to be picklable, while this tries to do it when passing errors between the runner and the host?

___________________________ test_hypothesis[firefox] ___________________________
pytest_pyodide/decorator.py:194: in test_hypothesis
    ???
pytest_pyodide/runner.py:212: in run_async
    return self.run_js(
pytest_pyodide/runner.py:249: in run_js
    return self.run_js_inner(code, check_code)
pytest_pyodide/runner.py:354: in run_js_inner
    raise JavascriptException(retval[1], retval[2])
E   pytest_pyodide.runner.JavascriptException: PythonError: Traceback (most recent call last):
E     File "<string>", line 104, in run_in_pyodide_main
E     File "/home/runner/work/pytest-pyodide/pytest-pyodide/tests/test_decorator.py", line 225, in test_hypothesis
E   pyodide.InternalError: Internal error occurred in compute_typeflags
E   
E   During handling of the above exception, another exception occurred:
E   
E   Traceback (most recent call last):
E     File "/lib/python3.10/asyncio/futures.py", line 201, in result
E       raise self._exception
E     File "/lib/python3.10/asyncio/tasks.py", line 232, in __step
E       result = coro.send(None)
E     File "<string>", line 116, in run_in_pyodide_main
E     File "<string>", line 75, in encode
E   _pickle.PicklingError: Can't pickle <class 'pyodide.InternalError'>: attribute lookup InternalError on pyodide failed

rth avatar Apr 04 '23 06:04 rth