Title: Incorrect returns caused by improper address filter in socket.getfqdn · Issue #100374 · python/cpython · GitHub
Open Graph Title: Incorrect returns caused by improper address filter in socket.getfqdn · Issue #100374 · python/cpython
X Title: Incorrect returns caused by improper address filter in socket.getfqdn · Issue #100374 · python/cpython
Description: Bug report 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 r...
Open Graph Description: Bug report 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...
X Description: Bug report When getfqdn called with name "::", instead of returning gethostname(), it will call gethostbyaddr("::"). This will raise an exception "socket.herror: [Errno 1] ...
Opengraph URL: https://github.com/python/cpython/issues/100374
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"Incorrect returns caused by improper address filter in socket.getfqdn","articleBody":"# Bug report\r\n\r\nWhen getfqdn called with name \"::\", instead of returning gethostname(), it will call gethostbyaddr(\"::\").\r\nThis 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)\r\nThe 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.\r\n\r\n```python\r\nimport socket\r\nsocket.getfqdn(\"::\") # This will block 30 seconds and returns \"::\" instead of hostname\r\n```\r\n\r\n# Your environment\r\n\r\n- 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\r\n- Operating system and architecture: macOS Ventura 13.0.0.1, arm64\n\n\u003c!-- gh-linked-prs --\u003e\n### Linked PRs\n* gh-100375\n* gh-100401\n* gh-100402\n\u003c!-- /gh-linked-prs --\u003e\n","author":{"url":"https://github.com/YuriNek0","@type":"Person","name":"YuriNek0"},"datePublished":"2022-12-20T16:00:07.000Z","interactionStatistic":{"@type":"InteractionCounter","interactionType":"https://schema.org/CommentAction","userInteractionCount":0},"url":"https://github.com/100374/cpython/issues/100374"}
| route-pattern | /_view_fragments/issues/show/:user_id/:repository/:id/issue_layout(.:format) |
| route-controller | voltron_issues_fragments |
| route-action | issue_layout |
| fetch-nonce | v2:ccbf6b7f-4b80-9e9f-c4f6-7d23c0d49961 |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | BA5E:2542A6:E07DD3:131F31D:69693A5A |
| html-safe-nonce | e5c0c198ba40136aa495439361c7d19ec1910cf3380f4ed1b9870e130e954491 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJCQTVFOjI1NDJBNjpFMDdERDM6MTMxRjMxRDo2OTY5M0E1QSIsInZpc2l0b3JfaWQiOiIzOTI4NzQ2NjU0ODkzMTYxMDUwIiwicmVnaW9uX2VkZ2UiOiJpYWQiLCJyZWdpb25fcmVuZGVyIjoiaWFkIn0= |
| visitor-hmac | d6faa37b7cfac6e9eb705008f090dc16c85c9d59fe8e31f3c6c8dd584104e3b8 |
| hovercard-subject-tag | issue:1504801804 |
| github-keyboard-shortcuts | repository,issues,copilot |
| google-site-verification | Apib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I |
| octolytics-url | https://collector.github.com/github/collect |
| analytics-location | / |
| fb:app_id | 1401488693436528 |
| apple-itunes-app | app-id=1477376905, app-argument=https://github.com/_view_fragments/issues/show/python/cpython/100374/issue_layout |
| twitter:image | https://opengraph.githubassets.com/571e94263688395605df343b1431490419109b202de24ee9e8dba9a857d98595/python/cpython/issues/100374 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/571e94263688395605df343b1431490419109b202de24ee9e8dba9a857d98595/python/cpython/issues/100374 |
| og:image:alt | Bug report 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... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | YuriNek0 |
| hostname | github.com |
| expected-hostname | github.com |
| None | 54182691a21263b584d2e600b758e081b0ff1d10ffc0d2eefa51cf754b43b51d |
| turbo-cache-control | no-preview |
| go-import | github.com/python/cpython git https://github.com/python/cpython.git |
| octolytics-dimension-user_id | 1525981 |
| octolytics-dimension-user_login | python |
| octolytics-dimension-repository_id | 81598961 |
| octolytics-dimension-repository_nwo | python/cpython |
| octolytics-dimension-repository_public | true |
| octolytics-dimension-repository_is_fork | false |
| octolytics-dimension-repository_network_root_id | 81598961 |
| octolytics-dimension-repository_network_root_nwo | python/cpython |
| turbo-body-classes | logged-out env-production page-responsive |
| disable-turbo | false |
| browser-stats-url | https://api.github.com/_private/browser/stats |
| browser-errors-url | https://api.github.com/_private/browser/errors |
| release | d69ac0477df0f87da03b8b06cebd187012d7a930 |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
Links:
Viewport: width=device-width