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
{{ message }}
Repository navigation
Incorrect returns caused by improper address filter in socket.getfqdn #100374
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. (Tested only on macOS Ventura 13.0.0.1, Python 3.10.6)
The solution is to add a filter to the first if statement, in line 792 socket.py, which will be included in my further pull-request.
importsocketsocket.getfqdn("::") # This will block 30 seconds and returns "::" instead of hostname
Your environment
CPython versions tested on: Python 3.10.6 (main, Aug 11 2022, 13:36:31) [Clang 13.1.6 (clang-1316.0.21.2.5)] on Darwin
Operating system and architecture: macOS Ventura 13.0.0.1, arm64
Activity
Added test case for pythonGH-100374.
gh-100374: Fixed a bug in socket.getfqdn() (gh-100375)
pythongh-100374: Fixed a bug in socket.getfqdn() (pythongh-100375)
pythongh-100374: Fixed a bug in socket.getfqdn() (pythongh-100375)
gh-100374: Fixed a bug in socket.getfqdn() (gh-100375)
gh-100374: Fixed a bug in socket.getfqdn() (gh-100375)
Merged main into regmachine branch (#50)