Right now attempts to use os.popen crash the entire python process:
~/python-wasm/packages/cpython$ ../../bin/python-wasm
Welcome to Node.js v16.13.0.
Type ".help" for more information.
> iPython 3.11.0b3 (main, Jul 23 2022, 06:21:39) [Clang 13.0.1 (git@github.com:ziglang/zig-bootstrap.git 623481199fe17f4311cbdbbf on wasi
Type "help", "copyright", "credits" or "license" for more information.
>>> import os
>>> os.popen('ls')
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "<frozen os>", line 986, in popen
File "/Users/wstein/build/cocalc/src/data/projects/2c9318d1-4f8b-4910-8da7-68a965514c95/python-wasm/packages/cpython/build/wasm/Lib/subprocess.py", line 805, in __init__
OSError: [Errno 58] wasi does not support processes.
>>>
~/python-wasm/packages/cpython$
It would be better if instead you see an error but the whole process doesn't exit. This must be possible, and might just involve improving whatever stub is being called.
The above error message comes from:
lib/python3.11/subprocess.py: errno.ENOTSUP, f"{sys.platform} does not support processes."
Right now attempts to use os.popen crash the entire python process:
It would be better if instead you see an error but the whole process doesn't exit. This must be possible, and might just involve improving whatever stub is being called.
The above error message comes from: