Message414595
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. |
|
Date |
User |
Action |
Args |
2022-03-05 20:50:25 | christian.heimes | set | recipients:
+ christian.heimes |
2022-03-05 20:50:25 | christian.heimes | set | messageid: <1646513425.19.0.684732114682.issue46933@roundup.psfhosted.org> |
2022-03-05 20:50:25 | christian.heimes | link | issue46933 messages |
2022-03-05 20:50:25 | christian.heimes | create | |
|