Skip to content

gh-148665: Enable socket.shutdown function for emscripten#148666

Merged
freakboy3742 merged 4 commits into
python:mainfrom
ryanking13:gh-148665-shutdown
Jul 21, 2026
Merged

gh-148665: Enable socket.shutdown function for emscripten#148666
freakboy3742 merged 4 commits into
python:mainfrom
ryanking13:gh-148665-shutdown

Conversation

@ryanking13

@ryanking13 ryanking13 commented Apr 17, 2026

Copy link
Copy Markdown
Contributor

Fixes #148665

Enables socket.shutdown method for emscripten

@python-cla-bot

python-cla-bot Bot commented Apr 17, 2026

Copy link
Copy Markdown

All commit authors signed the Contributor License Agreement.

CLA signed

@picnixz

picnixz commented Apr 19, 2026

Copy link
Copy Markdown
Member

I am sorry but this would be a breaking change. So I prefer that we first reach a consensus (which is the usual process).

@picnixz picnixz closed this Apr 19, 2026
@ryanking13

Copy link
Copy Markdown
Contributor Author

I am sorry but this would be a breaking change. So I prefer that we first reach a consensus (which is the usual process).

Sure. I totally agree with that point.

@freakboy3742

Copy link
Copy Markdown
Contributor

@picnixz I'm not sure I follow why would this be a breaking change. Nobody will be using socket.shutdown on Emscripten at present, because it will be raising an exception (OSError?); and as far as I can tell, the internal uses inside the Python standard library (such as TCPServer.shutdown_request() are catching the OSError and making it a no-op; th

What's the concern here about a breaking change? Is there a detail I'm missing?

@picnixz

picnixz commented Jul 15, 2026

Copy link
Copy Markdown
Member

The breaking change was about the hasattr checks and exception catching. It may be a non-issue but this should be taken into account (see issue). I closed the PR because we usually first discuss such changes before a PR.

If you believe this would not be an issue then it is fine as well but we need to convene the change more loudly (in terms of docs). I just did not want a PR sitting there without a clear "yes" on the issue.

@picnixz

picnixz commented Jul 19, 2026

Copy link
Copy Markdown
Member

Considering #148665 (comment), I'm reopening the PR. I'll let @hoodmane shepherd this then.

@picnixz picnixz reopened this Jul 19, 2026
@picnixz
picnixz requested a review from hoodmane July 19, 2026 14:08
@freakboy3742 freakboy3742 added the needs backport to 3.15 pre-release feature fixes, bugs and security fixes label Jul 21, 2026

@freakboy3742 freakboy3742 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍

@freakboy3742
freakboy3742 merged commit 20b7e8e into python:main Jul 21, 2026
40 checks passed
@miss-islington-app

Copy link
Copy Markdown

Thanks @ryanking13 for the PR, and @freakboy3742 for merging it 🌮🎉.. I'm working now to backport this PR to: 3.15.
🐍🍒⛏🤖

@bedevere-app

bedevere-app Bot commented Jul 21, 2026

Copy link
Copy Markdown

GH-154319 is a backport of this pull request to the 3.15 branch.

@bedevere-app bedevere-app Bot removed the needs backport to 3.15 pre-release feature fixes, bugs and security fixes label Jul 21, 2026
freakboy3742 pushed a commit that referenced this pull request Jul 21, 2026
…148666) (#154319)

Re-enable the autoconf check for socket.shutdown on Emscripten, as some
Emscripten environments are able to provide this call.
(cherry picked from commit 20b7e8e)

Co-authored-by: Gyeongjae Choi <gyeongjae@cloudflare.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Enable socket.shutdown function for emscripten builds

4 participants