You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
WebAssembly platforms like wasm32-emscripten and wasm32-wasi don't have a typical user and group database.
WASI platform does not provide necessary API functions at all. Emscripten provides dummy stubs. On Emscripten the pwd module compiles, but is non-functional:
Python 3.11.0a4+ (heads/main-dirty:b1a3446, Jan 25 2022, 10:19:07) [Clang 14.0.0 (https://github.com/llvm/llvm-project f142c45f1e494f8dbdcc1bcf1412 on emscripten
Type "help", "copyright", "credits" or "license" for more information.
>>> import pwd, os
>>> os.getuid()
0
>>> pwd.getpwall()
[]
>>> pwd.getpwuid(os.getuid())
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
KeyError: 'getpwuid(): uid not found: 0'
I propose to make the pwd optional and catch import error in few places where the pwd module is used to look up user home directory.
Note: these values reflect the state of the issue at the time it was migrated and might not reflect the current state.
Show more details
GitHub fields:
bugs.python.org fields:
The text was updated successfully, but these errors were encountered: