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
>>> import socket
>>> s = socket.socket()
>>> s.shutdown
Traceback (most recent call last):
File "<console>", line 1, in <module>
AttributeError: 'socket' object has no attribute 'shutdown'
This is because the Emscripten does not have a proper socket support by default, therefore only have a stub implementation of shutdown syscall. So users who try to use socket.shutdown would see an error "Function not implemented" anyways.
However, I would like to propose enabling socket.shutdown for following reasons:
We can overwrite Emscripten's socket syscall implementation to support shutdown in some environments. We are already doing that for some syscalls in Emscripten.
Even without 1 and 2, I think it is less surprising to show "Function not implemented" error than "AttributeError: 'socket' object has no attribute 'shutdown'"
Bug report
Bug description:
Currently,
socket.shutdownis disabled in Emscripten build.cpython/Platforms/emscripten/config.site-wasm32-emscripten
Lines 24 to 25 in 2a07ff9
This is because the Emscripten does not have a proper socket support by default, therefore only have a stub implementation of shutdown syscall. So users who try to use socket.shutdown would see an error "Function not implemented" anyways.
However, I would like to propose enabling socket.shutdown for following reasons:
CPython versions tested on:
3.15
Operating systems tested on:
Other
Linked PRs