René's URL Explorer Experiment


Title: `create_connection` and `create_server` in `asyncio` didn't work with a Python build with IPv6 disabled · Issue #121913 · python/cpython · GitHub

Open Graph Title: `create_connection` and `create_server` in `asyncio` didn't work with a Python build with IPv6 disabled · Issue #121913 · python/cpython

X Title: `create_connection` and `create_server` in `asyncio` didn't work with a Python build with IPv6 disabled · Issue #121913 · python/cpython

Description: Bug report Bug description: Build Python with the configuration --disable-ipv6, and run the test with ./python.exe -m test test_asyncio.test_events -m 'test_create_connection_local_addr_skip_different_family' -v. You will encounter the f...

Open Graph Description: Bug report Bug description: Build Python with the configuration --disable-ipv6, and run the test with ./python.exe -m test test_asyncio.test_events -m 'test_create_connection_local_addr_skip_differ...

X Description: Bug report Bug description: Build Python with the configuration --disable-ipv6, and run the test with ./python.exe -m test test_asyncio.test_events -m 'test_create_connection_local_addr_skip_di...

Opengraph URL: https://github.com/python/cpython/issues/121913

X: @github

direct link

Domain: github.com


Hey, it has json ld scripts:
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"`create_connection` and `create_server` in `asyncio` didn't work with a Python build with IPv6 disabled","articleBody":"# Bug report\r\n\r\n### Bug description:\r\n\r\nBuild Python with the configuration `--disable-ipv6`, and run the test with `./python.exe -m test test_asyncio.test_events -m 'test_create_connection_local_addr_skip_different_family' -v`. You will encounter the following error stack:\r\n\r\n```\r\nERROR: test_create_connection_local_addr_skip_different_family (test.test_asyncio.test_events.SelectEventLoopTests.test_create_connection_local_addr_skip_different_family)\r\n----------------------------------------------------------------------\r\nTraceback (most recent call last):\r\n  File \"/Users/asaka/Codes/cpython/Lib/asyncio/base_events.py\", line 1026, in _connect_sock\r\n    sock.bind(laddr)\r\nOSError: bind(): bad family\r\n\r\nDuring handling of the above exception, another exception occurred:\r\n\r\nTraceback (most recent call last):\r\n  File \"/Users/asaka/Codes/cpython/Lib/test/test_asyncio/test_events.py\", line 695, in test_create_connection_local_addr_skip_different_family\r\n    self.loop.run_until_complete(f)\r\n  File \"/Users/asaka/Codes/cpython/Lib/asyncio/base_events.py\", line 721, in run_until_complete\r\n    return future.result()\r\n  File \"/Users/asaka/Codes/cpython/Lib/asyncio/base_events.py\", line 1138, in create_connection\r\n    sock = await self._connect_sock(exceptions, addrinfo, laddr_infos)\r\n  File \"/Users/asaka/Codes/cpython/Lib/asyncio/base_events.py\", line 1032, in _connect_sock\r\n    f'{exc.strerror.lower()}'\r\nAttributeError: 'NoneType' object has no attribute 'lower'\r\n```\r\n\r\nThis issue not only affects the test but also user's code.\r\n\r\nAfter some research, I found that it's caused by these two functions, which use `getaddrinfo` to get a list of connection infos and then attempt to call `bind` for each of the infos, ignoring `OSError` until a working one is found.\r\n\r\nHowever, in the iteration code, it attempts to use `OSError().strerror` to create a new error. Unfortunately, some `OSError` instances have a `strerror` field of `None`. The error raised by `sock.bind` with `AF_INET6` when `--disable-ipv6` is used does not have this field, leading to an error that prevents the iteration loop from trying the next potential solution.\r\n\r\nThere are already reports for the missing `strerror` / `errno` fields issues: [https://github.com/python/cpython/issues/109601](https://github.com/python/cpython/issues/109601) and [https://github.com/python/cpython/issues/50720](https://github.com/python/cpython/issues/50720) with a draft PR #109720.\r\n\r\nBut before we fix this issue, should we provide a workaround for this specific problem, like using `str(exc)` instead of `exc.strerror`, or skip this loop if `not socket.has_ipv6` and current family is `AF_INET6`?\r\n\r\n### CPython versions tested on:\r\n\r\nCPython main branch\r\n\r\n### Operating systems tested on:\r\n\r\nmacOS\n\n\u003c!-- gh-linked-prs -->\n### Linked PRs\n* gh-122269\n* gh-122278\n* gh-122279\n\u003c!-- /gh-linked-prs -->\n","author":{"url":"https://github.com/aisk","@type":"Person","name":"aisk"},"datePublished":"2024-07-17T13:37:35Z","url":"https://github.com/python/cpython/issues/121913"}

react-profiling0
react-import-mapreact,react-dom,react-dom/client,react-dom/profiling,react-is,react/compiler-runtime,react/jsx-dev-runtime,react/jsx-runtime,scheduler@b8488ee2c322
route-pattern/_view_fragments/issues/show/:user_id/:repository/:id/issue_layout(.:format)
route-controllervoltron_issues_fragments
route-actionissue_layout
fetch-noncev2:c0b17e2e-6f5d-5754-d5e0-3196ecdb1624
current-catalog-service-hash81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114
request-id8694:106F5D:D494A4:11D61DD:6B005475
html-safe-nonceb6183d494c0a4443c6160c681df7b511f488a1209d5624538e47054c234dc48b
visitor-payloadeyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiI4Njk0OjEwNkY1RDpENDk0QTQ6MTFENjFERDo2QjAwNTQ3NSIsInZpc2l0b3JfaWQiOiI3MzQyNjgzMTkwNjE3NzI0MDIxIiwicmVnaW9uX2VkZ2UiOiJpYWQiLCJyZWdpb25fcmVuZGVyIjoiaWFkIn0=
visitor-hmace2f879b690c6cd1a78f62daa7dff13cdc3f38ef1d0b00c707ced5f62f11e4ca4
hovercard-subject-tagissue:2413651427
github-keyboard-shortcutsrepository,issues,copilot
google-site-verificationApib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I
octolytics-urlhttps://collector.github.com/github/collect
analytics-location///voltron/issues_fragments/issue_layout
fb:app_id1401488693436528
apple-itunes-appapp-id=1477376905, app-argument=https://github.com/_view_fragments/issues/show/python/cpython/121913/issue_layout
twitter:imagehttps://opengraph.githubassets.com/01d2fca8a77b849898209d7800f80002f3035bd004ea66ffec3ce3d6fc68a3d1/python/cpython/issues/121913
twitter:cardsummary_large_image
og:imagehttps://opengraph.githubassets.com/01d2fca8a77b849898209d7800f80002f3035bd004ea66ffec3ce3d6fc68a3d1/python/cpython/issues/121913
og:image:altBug report Bug description: Build Python with the configuration --disable-ipv6, and run the test with ./python.exe -m test test_asyncio.test_events -m 'test_create_connection_local_addr_skip_differ...
og:image:width1200
og:image:height600
og:site_nameGitHub
og:typeobject
og:author:usernameaisk
hostnamegithub.com
expected-hostnamegithub.com
Nonef420f4996e6b1ff1ccd6d7683f8134f4b5f0f8a50124c210dbfe7490e5644abb
turbo-cache-controlno-preview
go-importgithub.com/python/cpython git https://github.com/python/cpython.git
octolytics-dimension-user_id1525981
octolytics-dimension-user_loginpython
octolytics-dimension-repository_id81598961
octolytics-dimension-repository_nwopython/cpython
octolytics-dimension-repository_publictrue
octolytics-dimension-repository_is_forkfalse
octolytics-dimension-repository_network_root_id81598961
octolytics-dimension-repository_network_root_nwopython/cpython
turbo-body-classeslogged-out env-production page-responsive
disable-turbofalse
browser-stats-urlhttps://api.github.com/_private/browser/stats
browser-errors-urlhttps://api.github.com/_private/browser/errors
release26e00df917aba0f128135dc073ea0c5e33a70d40
ui-targetfull
theme-color#1e2327
color-schemelight dark
react-app-nameissues

Links:

Skip to contenthttps://github.com/python/cpython/issues/121913#start-of-content
https://github.com/
Sign inhttps://github.com/login?return_to=https%3A%2F%2Fgithub.com%2Fpython%2Fcpython%2Fissues%2F121913
GitHubRepository hosting, code review, and collaborationhttps://github.com/platform
CopilotAI coding agent for tasks, projects, and automated workhttps://github.com/features/copilot
ActionsCI/CD and automationhttps://github.com/features/actions
Code QualityQuality analysis, fixes, and enforcementhttps://github.com/features/code-quality
CodespacesCloud development environmentshttps://github.com/features/codespaces
Code SecurityVulnerability detection and remediationhttps://github.com/security/advanced-security/code-security
Secret ProtectionSecret scanning and leak preventionhttps://github.com/security/advanced-security/secret-protection
All Featureshttps://github.com/features
Documentationhttps://docs.github.com/en
Traininghttps://learn.github.com/skills
Certificationshttps://learn.github.com/credentials
Build with Copilothttps://github.com/features/ai
Customize Copilothttps://docs.github.com/en/copilot/how-tos/copilot-on-github/customize-copilot/customize-copilot-overview
Integrationshttps://github.com/marketplace
Trending reposhttps://github.com/trending
GitHub Sponsorshttps://github.com/open-source/sponsors
Developer articleshttps://github.com/resources/articles
ChangelogYour source for the latest features, improvements, and fixes across GitHub products, all in one place.https://github.blog/changelog/
Enterpriseshttps://github.com/enterprise
Teamhttps://github.com/team
Startupshttps://github.com/enterprise/startups
Nonprofitshttps://github.com/solutions/industry/nonprofits
Healthcarehttps://github.com/solutions/industry/healthcare
Financial serviceshttps://github.com/solutions/industry/financial-services
Manufacturinghttps://github.com/solutions/industry/manufacturing
Governmenthttps://github.com/solutions/industry/government
See all industrieshttps://github.com/solutions/industry
Why GitHubhttps://github.com/why-github
Customer Storieshttps://github.com/customer-stories
Business insightshttps://github.com/solutions/executive-insights
Trust Centerhttps://github.com/trust-center
GitHub Advanced SecurityEnterprise-grade code securityhttps://github.com/security/advanced-security
Copilot for businessEnterprise-grade AI featureshttps://github.com/features/copilot/copilot-business
Premium SupportEnterprise-grade 24/7 supporthttps://github.com/enterprise/premium-support
Documentationhttps://docs.github.com/en
Resource centerhttps://github.com/resources
Bloghttps://github.blog/
Events & webinarshttps://github.com/resources/events
Community Forumhttps://github.com/orgs/community/discussions
Customer Storieshttps://github.com/customer-stories
Integrationshttps://github.com/marketplace
Customer supporthttps://help.github.com/
Traininghttps://learn.github.com/skills
GitHub Statushttps://www.githubstatus.com/
Abouthttps://github.com/about
Partnershttps://github.com/partners
Changeloghttps://github.blog/changelog/
GitHub UniverseThe event for developers, by developers — talks, workshops, and what’s next for GitHub.https://githubuniverse.com/
Pricinghttps://github.com/pricing
Sign inhttps://github.com/login?return_to=https%3A%2F%2Fgithub.com%2Fpython%2Fcpython%2Fissues%2F121913
Sign uphttps://github.com/signup?ref_cta=Sign+up&ref_loc=header+logged+out&ref_page=%2F%3Cuser-name%3E%2F%3Crepo-name%3E%2Fvoltron%2Fissues_fragments%2Fissue_layout&source=header-repo&source_repo=python%2Fcpython
Reloadhttps://github.com/python/cpython/issues/121913
Reloadhttps://github.com/python/cpython/issues/121913
Reloadhttps://github.com/python/cpython/issues/121913
pythonhttps://github.com/python
cpythonhttps://github.com/python/cpython
Codehttps://github.com/python/cpython
Issues5k+ (5k+)https://github.com/python/cpython/issues
Pull requests2.4k (2.4k)https://github.com/python/cpython/pulls
Actionshttps://github.com/python/cpython/actions
Projectshttps://github.com/python/cpython/projects
Security and qualityhttps://github.com/python/cpython/security
Insightshttps://github.com/python/cpython/insights
https://github.com/python/cpython
New issuehttps://github.com/login?return_to=https://github.com/python/cpython/issues/121913
New issuehttps://github.com/login?return_to=https://github.com/python/cpython/issues/121913
create_connection and create_server in asyncio didn't work with a Python build with IPv6 disabledhttps://github.com/python/cpython/issues/121913#top
stdlibStandard Library Python modules in the Lib/ directoryhttps://github.com/python/cpython/issues?q=state%3Aopen%20label%3A%22stdlib%22
topic-asynciohttps://github.com/python/cpython/issues?q=state%3Aopen%20label%3A%22topic-asyncio%22
type-bugAn unexpected behavior, bug, or errorhttps://github.com/python/cpython/issues?q=state%3Aopen%20label%3A%22type-bug%22
https://github.com/aisk
aiskhttps://github.com/aisk
on Jul 17, 2024https://github.com/python/cpython/issues/121913#issue-2413651427
#109601https://github.com/python/cpython/issues/109601
#50720https://github.com/python/cpython/issues/50720
#109720https://github.com/python/cpython/pull/109720
gh-121913: Using str(exc) instead of exc.strerror in asyncio.base_events #122269https://github.com/python/cpython/pull/122269
[3.13] gh-121913: Use str(exc) instead of exc.strerror in asyncio.base_events (GH-122269) #122278https://github.com/python/cpython/pull/122278
[3.12] gh-121913: Use str(exc) instead of exc.strerror in asyncio.base_events (GH-122269) #122279https://github.com/python/cpython/pull/122279
aiskhttps://github.com/aisk
type-bugAn unexpected behavior, bug, or errorhttps://github.com/python/cpython/issues?q=state%3Aopen%20label%3A%22type-bug%22
stdlibStandard Library Python modules in the Lib/ directoryhttps://github.com/python/cpython/issues?q=state%3Aopen%20label%3A%22stdlib%22
topic-asynciohttps://github.com/python/cpython/issues?q=state%3Aopen%20label%3A%22topic-asyncio%22
on Jul 17, 2024https://github.com/python/cpython/issues/121913#event-13536959514
github-project-automationhttps://github.com/apps/github-project-automation
asynciohttps://github.com/orgs/python/projects/29
on Jul 17, 2024https://github.com/python/cpython/issues/121913#event-14873011189
github-project-automationhttps://github.com/apps/github-project-automation
asynciohttps://github.com/orgs/python/projects/29
on Jul 17, 2024https://github.com/python/cpython/issues/121913
https://github.com/kumaraditya303
kumaraditya303https://github.com/kumaraditya303
on Jul 25, 2024https://github.com/python/cpython/issues/121913#issuecomment-2249771260
@aiskhttps://github.com/aisk
https://github.com/aisk
aiskhttps://github.com/aisk
on Jul 25, 2024https://github.com/python/cpython/issues/121913#issuecomment-2249812834
kumaraditya303https://github.com/kumaraditya303
on Jul 25, 2024https://github.com/python/cpython/issues/121913#event-13644589547
gh-121913: Use str(exc) instead of exc.strerror in `asyncio.base_even…https://github.com/python/cpython/commit/070f1e2e5b9b31ee3e7a1af2e30d7e3a66040b17
gh-121913https://github.com/python/cpython/issues/121913
070f1e2https://github.com/python/cpython/commit/070f1e2e5b9b31ee3e7a1af2e30d7e3a66040b17
miss-islingtonhttps://github.com/miss-islington
on Jul 25, 2024https://github.com/python/cpython/issues/121913#event-13644591123
pythongh-121913: Use str(exc) instead of exc.strerror in `asyncio.bas…https://github.com/miss-islington/cpython/commit/658de64d1bf43de982cf7f29d2aa7dc0cf60275d
pythongh-121913https://github.com/python/cpython/issues/121913
658de64https://github.com/miss-islington/cpython/commit/658de64d1bf43de982cf7f29d2aa7dc0cf60275d
pythongh-121913: Use str(exc) instead of exc.strerror in `asyncio.bas…https://github.com/miss-islington/cpython/commit/602d7ed43f40bf769d7bad3235d5e36a89899359
pythongh-121913https://github.com/python/cpython/issues/121913
602d7edhttps://github.com/miss-islington/cpython/commit/602d7ed43f40bf769d7bad3235d5e36a89899359
https://github.com/kumaraditya303
kumaraditya303https://github.com/kumaraditya303
on Jul 25, 2024https://github.com/python/cpython/issues/121913#issuecomment-2250166952
kumaraditya303https://github.com/kumaraditya303
completedhttps://github.com/python/cpython/issues?q=is%3Aissue%20state%3Aclosed%20archived%3Afalse%20reason%3Acompleted
on Jul 25, 2024https://github.com/python/cpython/issues/121913#event-13644728884
github-project-automationhttps://github.com/apps/github-project-automation
asynciohttps://github.com/orgs/python/projects/29
on Jul 25, 2024https://github.com/python/cpython/issues/121913
kumaraditya303https://github.com/kumaraditya303
on Jul 25, 2024https://github.com/python/cpython/issues/121913#event-13644829761
[3.12] gh-121913: Use str(exc) instead of exc.strerror in `asyncio.ba…https://github.com/python/cpython/commit/0300e33b223a6cfd691bea186cd413424162d83a
gh-121913https://github.com/python/cpython/issues/121913
0300e33https://github.com/python/cpython/commit/0300e33b223a6cfd691bea186cd413424162d83a
[3.13] gh-121913: Use str(exc) instead of exc.strerror in `asyncio.ba…https://github.com/python/cpython/commit/d1af4f53720d252326ae9c91c93495b58e0b4922
gh-121913https://github.com/python/cpython/issues/121913
d1af4f5https://github.com/python/cpython/commit/d1af4f53720d252326ae9c91c93495b58e0b4922
shadchinhttps://github.com/shadchin
on Aug 11, 2024https://github.com/python/cpython/issues/121913#event-13835537937
Fix test_create_server_4https://github.com/shadchin/uvloop/commit/da8c45629977460c11eca95ce881d5bcbfd4b403
da8c456https://github.com/shadchin/uvloop/commit/da8c45629977460c11eca95ce881d5bcbfd4b403
fantixhttps://github.com/fantix
on Aug 13, 2024https://github.com/python/cpython/issues/121913#event-13864357067
Fix test_create_server_4 with Python 3.12.5 (#614)https://github.com/MagicStack/uvloop/commit/62f92393b057fc94cf1fc259cf1e6ca8a8c4a1e7
#614https://github.com/MagicStack/uvloop/pull/614
62f9239https://github.com/MagicStack/uvloop/commit/62f92393b057fc94cf1fc259cf1e6ca8a8c4a1e7
Sign up for freehttps://github.com/signup?return_to=https://github.com/python/cpython/issues/121913
Sign in to commenthttps://github.com/login?return_to=https://github.com/python/cpython/issues/121913
stdlibStandard Library Python modules in the Lib/ directoryhttps://github.com/python/cpython/issues?q=state%3Aopen%20label%3A%22stdlib%22
topic-asynciohttps://github.com/python/cpython/issues?q=state%3Aopen%20label%3A%22topic-asyncio%22
type-bugAn unexpected behavior, bug, or errorhttps://github.com/python/cpython/issues?q=state%3Aopen%20label%3A%22type-bug%22
asynciohttps://github.com/orgs/python/projects/29
https://github.com
Termshttps://docs.github.com/site-policy/github-terms/github-terms-of-service
Privacyhttps://docs.github.com/site-policy/privacy-policies/github-privacy-statement
Securityhttps://github.com/security
Statushttps://www.githubstatus.com/
Communityhttps://github.community/
Docshttps://docs.github.com/
Contacthttps://support.github.com?tags=dotcom-footer

Viewport: width=device-width


URLs of crawlers that visited me.