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

gh-100374: Fixed a bug in socket.getfqdn() #100375

Merged
merged 7 commits into from Dec 21, 2022
Merged

gh-100374: Fixed a bug in socket.getfqdn() #100375

merged 7 commits into from Dec 21, 2022

Conversation

MTAwsl
Copy link
Contributor

@MTAwsl MTAwsl commented Dec 20, 2022

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.

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.
@bedevere-bot
Copy link

bedevere-bot commented Dec 20, 2022

Most changes to Python require a NEWS entry.

Please add it using the blurb_it web app or the blurb command-line tool.

@cpython-cla-bot
Copy link

cpython-cla-bot bot commented Dec 20, 2022

All commit authors signed the Contributor License Agreement.
CLA signed

Copy link
Member

@corona10 corona10 left a comment

Would you like to add the test for this case?

@bedevere-bot
Copy link

bedevere-bot commented Dec 21, 2022

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 I have made the requested changes; please review again. I will then notify any core developers who have left a review that you're ready for them to take another look at this pull request.

@MTAwsl
Copy link
Contributor Author

MTAwsl commented Dec 21, 2022

Added test cases in Lib/test/test_socket.py.

I have made the requested changes; please review again

@bedevere-bot
Copy link

bedevere-bot commented Dec 21, 2022

Thanks for making the requested changes!

@corona10: please review the changes made to this pull request.

@bedevere-bot bedevere-bot requested a review from corona10 Dec 21, 2022
Lib/socket.py Outdated Show resolved Hide resolved
Copy link
Member

@corona10 corona10 left a comment

I left nit comment.

@bedevere-bot
Copy link

bedevere-bot commented Dec 21, 2022

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 I have made the requested changes; please review again. I will then notify any core developers who have left a review that you're ready for them to take another look at this pull request.

MTAwsl and others added 2 commits Dec 21, 2022
…e-100374.YRrVHT.rst

Co-authored-by: Dong-hee Na <donghee.na92@gmail.com>
Co-authored-by: Dong-hee Na <donghee.na92@gmail.com>
@MTAwsl
Copy link
Contributor Author

MTAwsl commented Dec 21, 2022

Thanks for your commit :)

I have made the requested changes; please review again

@bedevere-bot
Copy link

bedevere-bot commented Dec 21, 2022

Thanks for making the requested changes!

@corona10: please review the changes made to this pull request.

@bedevere-bot bedevere-bot requested a review from corona10 Dec 21, 2022
Copy link
Member

@corona10 corona10 left a comment

lgtm

@corona10 corona10 merged commit 12be23c into python:main Dec 21, 2022
16 checks passed
@miss-islington
Copy link
Contributor

miss-islington commented Dec 21, 2022

Thanks @MTAwsl for the PR, and @corona10 for merging it 🌮🎉.. I'm working now to backport this PR to: 3.10, 3.11.
🐍🍒🤖 I'm not a witch! I'm not a witch!

@bedevere-bot
Copy link

bedevere-bot commented Dec 21, 2022

GH-100401 is a backport of this pull request to the 3.11 branch.

@bedevere-bot
Copy link

bedevere-bot commented Dec 21, 2022

GH-100402 is a backport of this pull request to the 3.10 branch.

miss-islington pushed a commit to miss-islington/cpython that referenced this pull request Dec 21, 2022
(cherry picked from commit 12be23cf3c1301be2c6b8fd4cb2cd35a567d2ea2)

Co-authored-by: Dominic Socular <BBH@awsl.rip>
miss-islington pushed a commit to miss-islington/cpython that referenced this pull request Dec 21, 2022
(cherry picked from commit 12be23cf3c1301be2c6b8fd4cb2cd35a567d2ea2)

Co-authored-by: Dominic Socular <BBH@awsl.rip>
miss-islington added a commit that referenced this pull request Dec 21, 2022
(cherry picked from commit 12be23c)

Co-authored-by: Dominic Socular <BBH@awsl.rip>
miss-islington added a commit that referenced this pull request Dec 21, 2022
(cherry picked from commit 12be23c)

Co-authored-by: Dominic Socular <BBH@awsl.rip>
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.

None yet

4 participants