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
gh-100374: Fixed a bug in socket.getfqdn() #100375
Conversation
When getfqdn called with name "::", instead of returning gethostname(), it will call gethostbyaddr("::"). This will raise an exception "socket.herror: [Errno 1] Unknown host", which will cause a 30 seconds(timeout) delay and return incorrect result. The solution is to add a filter to the first if statement, in line 792 socket.py.
Most changes to Python require a NEWS entry. Please add it using the blurb_it web app or the blurb command-line tool. |
A Python core developer has requested some changes be made to your pull request before we can consider merging it. If you could please address their requests along with any other requests in other reviews from core developers that would be appreciated. Once you have made the requested changes, please leave a comment on this pull request containing the phrase |
Added test cases in Lib/test/test_socket.py. I have made the requested changes; please review again |
Thanks for making the requested changes! @corona10: please review the changes made to this pull request. |
Misc/NEWS.d/next/Core and Builtins/2022-12-20-16-14-19.gh-issue-100374.YRrVHT.rst
Outdated
Show resolved
Hide resolved
A Python core developer has requested some changes be made to your pull request before we can consider merging it. If you could please address their requests along with any other requests in other reviews from core developers that would be appreciated. Once you have made the requested changes, please leave a comment on this pull request containing the phrase |
…e-100374.YRrVHT.rst Co-authored-by: Dong-hee Na <donghee.na92@gmail.com>
Co-authored-by: Dong-hee Na <donghee.na92@gmail.com>
Thanks for your commit :) I have made the requested changes; please review again |
Thanks for making the requested changes! @corona10: please review the changes made to this pull request. |
GH-100401 is a backport of this pull request to the 3.11 branch. |
GH-100402 is a backport of this pull request to the 3.10 branch. |
(cherry picked from commit 12be23cf3c1301be2c6b8fd4cb2cd35a567d2ea2) Co-authored-by: Dominic Socular <BBH@awsl.rip>
(cherry picked from commit 12be23cf3c1301be2c6b8fd4cb2cd35a567d2ea2) Co-authored-by: Dominic Socular <BBH@awsl.rip>
When getfqdn called with name "::", instead of returning gethostname(), it will call gethostbyaddr("::"). This will raise an exception "socket.herror: [Errno 1] Unknown host", which will cause a 30 seconds(timeout) delay and return incorrect result. The solution is to add a filter to the first if statement, in line 792 socket.py.