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

bpo-27929: resolve names only for AF_INET/AF_INET6 with asyncio #32131

Merged
merged 2 commits into from Mar 28, 2022

Conversation

vincentbernat
Copy link
Contributor

@vincentbernat vincentbernat commented Mar 26, 2022

For other families, it may not make sense to resolve names. For
example, with AF_BLUETOOTH, there is no name resolution and attempting
to do so will trigger a "ai_family not supported".

The bug report contains an example:

import asyncio
import socket
sock = socket.socket(family=socket.AF_BLUETOOTH,
                     type=socket.SOCK_STREAM,
                     proto=socket.BTPROTO_RFCOMM)
sock.setblocking(False)
addr = "00:12:34:56:78:99"
loop = asyncio.get_event_loop()
loop.run_until_complete(loop.sock_connect(sock, (addr, 1)))

https://bugs.python.org/issue27929

https://bugs.python.org/issue27929

@the-knights-who-say-ni
Copy link

Hello, and thanks for your contribution!

I'm a bot set up to make sure that the project can legally accept this contribution by verifying everyone involved has signed the PSF contributor agreement (CLA).

CLA Missing

Our records indicate the following people have not signed the CLA:

@vincentbernat

For legal reasons we need all the people listed to sign the CLA before we can look at your contribution. Please follow the steps outlined in the CPython devguide to rectify this issue.

If you have recently signed the CLA, please wait at least one business day
before our records are updated.

You can check yourself to see if the CLA has been received.

Thanks again for the contribution, we look forward to reviewing it!

Copy link
Contributor

@asvetlov asvetlov left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

  1. Please add NEWS entry (https://devguide.python.org/#quick-reference point 8)
  2. Python can be compiled without IPv6 support, socket.AF_INET6 is not available. Please use base_events._HAS_IPv6.

@bedevere-bot
Copy link

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.

For other families, it may not make sense to resolve names. For
example, with AF_BLUETOOTH, there is no name resolution and attempting
to do so will trigger a "ai_family not supported".

The bug report contains an example:

```python
import asyncio
import socket
sock = socket.socket(family=socket.AF_BLUETOOTH,
                     type=socket.SOCK_STREAM,
                     proto=socket.BTPROTO_RFCOMM)
sock.setblocking(False)
addr = "00:12:34:56:78:99"
loop = asyncio.get_event_loop()
loop.run_until_complete(loop.sock_connect(sock, (addr, 1)))
```

https://bugs.python.org/issue27929
@asvetlov asvetlov added needs backport to 3.9 only security fixes needs backport to 3.10 only security fixes labels Mar 28, 2022
@asvetlov asvetlov merged commit 5c30388 into python:main Mar 28, 2022
@miss-islington
Copy link
Contributor

Thanks @vincentbernat for the PR, and @asvetlov for merging it 🌮🎉.. I'm working now to backport this PR to: 3.9, 3.10.
🐍🍒⛏🤖

@asvetlov
Copy link
Contributor

Thanks!

miss-islington pushed a commit to miss-islington/cpython that referenced this pull request Mar 28, 2022
…onGH-32131)

Co-authored-by: Andrew Svetlov <andrew.svetlov@gmail.com>
(cherry picked from commit 5c30388)

Co-authored-by: Vincent Bernat <vincent@bernat.ch>
miss-islington pushed a commit to miss-islington/cpython that referenced this pull request Mar 28, 2022
…onGH-32131)

Co-authored-by: Andrew Svetlov <andrew.svetlov@gmail.com>
(cherry picked from commit 5c30388)

Co-authored-by: Vincent Bernat <vincent@bernat.ch>
@bedevere-bot bedevere-bot removed the needs backport to 3.10 only security fixes label Mar 28, 2022
@bedevere-bot
Copy link

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

@bedevere-bot
Copy link

GH-32165 is a backport of this pull request to the 3.9 branch.

@bedevere-bot bedevere-bot removed the needs backport to 3.9 only security fixes label Mar 28, 2022
miss-islington added a commit that referenced this pull request Mar 28, 2022
…2131)

Co-authored-by: Andrew Svetlov <andrew.svetlov@gmail.com>
(cherry picked from commit 5c30388)

Co-authored-by: Vincent Bernat <vincent@bernat.ch>
miss-islington added a commit that referenced this pull request Mar 28, 2022
…2131)

Co-authored-by: Andrew Svetlov <andrew.svetlov@gmail.com>
(cherry picked from commit 5c30388)

Co-authored-by: Vincent Bernat <vincent@bernat.ch>
hello-adam pushed a commit to hello-adam/cpython that referenced this pull request Jun 2, 2022
…onGH-32131)

Co-authored-by: Andrew Svetlov <andrew.svetlov@gmail.com>
(cherry picked from commit 5c30388)

Co-authored-by: Vincent Bernat <vincent@bernat.ch>
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

5 participants