Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

bpo-38907: In http.server script, restore binding to IPv4 on Windows. #17851

Merged
merged 2 commits into from Jan 6, 2020

Conversation

@jaraco
Copy link
Member

jaraco commented Jan 6, 2020

This PR takes a more surgical approach to GH-17378, addressing only the regression introduced with the dual-stack support added in 3.8 for the http.server command. Presumably, better support will be added to the HTTPServer and TCPServers for dual-stack support in bpo-25667 or bpo-20215, but this PR aims to minimally restore the prior expectation and not affect the behavior of those classes.

I considered writing tests for this change, but the existing tests for the http.server command mock out the intended behavior, so I've instead tested the change by applying the patch to Python 3.8.1 on Windows and confirmed it has the intended effect.

https://bugs.python.org/issue38907

@jaraco jaraco added the OS-windows label Jan 6, 2020
@jaraco jaraco merged commit ee94bdb into python:master Jan 6, 2020
9 checks passed
9 checks passed
Docs
Details
Windows (x86)
Details
Windows (x64)
Details
macOS
Details
Ubuntu
Details
Azure Pipelines PR #20200106.2 succeeded
Details
bedevere/issue-number Issue number 38907 found
Details
bedevere/news News entry found in Misc/NEWS.d
continuous-integration/travis-ci/pr The Travis CI build passed
Details
@jaraco jaraco deleted the jaraco:bugfix/38907-restore-ipv4-bind-windows branch Jan 6, 2020
@miss-islington

This comment has been minimized.

Copy link

miss-islington commented Jan 6, 2020

Thanks @jaraco for the PR 🌮🎉.. I'm working now to backport this PR to: 3.8.
🐍🍒🤖

@bedevere-bot

This comment has been minimized.

Copy link

bedevere-bot commented Jan 6, 2020

GH-17854 is a backport of this pull request to the 3.8 branch.

@jaraco

This comment has been minimized.

Copy link
Member Author

jaraco commented Jan 6, 2020

This change is unsuitable; the call to setsockopt needs to be called only when the socket is using IPv6 protocol.

jaraco added a commit that referenced this pull request Jan 6, 2020
…GH-17851) (#17854)

(cherry picked from commit ee94bdb)

Co-authored-by: Jason R. Coombs <jaraco@jaraco.com>

Co-authored-by: Jason R. Coombs <jaraco@jaraco.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
4 participants
You can’t perform that action at this time.