[issue46827] asyncio SelectorEventLoop.sock_connect fails with a UDP socket

2022-02-22 Thread Andrew Svetlov


Change by Andrew Svetlov :


--
resolution:  -> fixed
stage: patch review -> resolved
status: open -> closed

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue46827] asyncio SelectorEventLoop.sock_connect fails with a UDP socket

2022-02-22 Thread miss-islington


miss-islington  added the comment:


New changeset 29e8c43b32d6f1ec2e8b4fd8c4903d30830f280f by Miss Islington (bot) 
in branch '3.9':
bpo-46827: pass sock.type to getaddrinfo in sock_connect (GH-31499)
https://github.com/python/cpython/commit/29e8c43b32d6f1ec2e8b4fd8c4903d30830f280f


--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue46827] asyncio SelectorEventLoop.sock_connect fails with a UDP socket

2022-02-22 Thread miss-islington


miss-islington  added the comment:


New changeset d327517b54c148eba499c777b99760356102cbe0 by Miss Islington (bot) 
in branch '3.10':
bpo-46827: pass sock.type to getaddrinfo in sock_connect (GH-31499)
https://github.com/python/cpython/commit/d327517b54c148eba499c777b99760356102cbe0


--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue46827] asyncio SelectorEventLoop.sock_connect fails with a UDP socket

2022-02-22 Thread Andrew Svetlov


Andrew Svetlov  added the comment:


New changeset 8fb94893e4a870ed3533e80c4bc2f1ebf1cfa9e7 by Thomas Grainger in 
branch 'main':
bpo-46827: pass sock.type to getaddrinfo in sock_connect (GH-31499)
https://github.com/python/cpython/commit/8fb94893e4a870ed3533e80c4bc2f1ebf1cfa9e7


--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue46827] asyncio SelectorEventLoop.sock_connect fails with a UDP socket

2022-02-22 Thread miss-islington


Change by miss-islington :


--
pull_requests: +29637
pull_request: https://github.com/python/cpython/pull/31510

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue46827] asyncio SelectorEventLoop.sock_connect fails with a UDP socket

2022-02-22 Thread miss-islington


Change by miss-islington :


--
nosy: +miss-islington
nosy_count: 3.0 -> 4.0
pull_requests: +29636
pull_request: https://github.com/python/cpython/pull/31509

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue46827] asyncio SelectorEventLoop.sock_connect fails with a UDP socket

2022-02-22 Thread Thomas Grainger


Change by Thomas Grainger :


--
keywords: +patch
pull_requests: +29629
stage:  -> patch review
pull_request: https://github.com/python/cpython/pull/31499

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue46827] asyncio SelectorEventLoop.sock_connect fails with a UDP socket

2022-02-22 Thread Thomas Grainger


New submission from Thomas Grainger :

the following code:

import socket
import asyncio

async def amain():
with socket.socket(family=socket.AF_INET, proto=socket.IPPROTO_UDP, 
type=socket.SOCK_DGRAM) as sock:
sock.setblocking(False)
await asyncio.get_running_loop().sock_connect(sock, ("google.com", 
"443"))

asyncio.run(amain())


fails with:

Traceback (most recent call last):
  File "/home/graingert/projects/test_foo.py", line 9, in 
asyncio.run(amain())
  File "/usr/lib/python3.10/asyncio/runners.py", line 44, in run
return loop.run_until_complete(main)
  File "/usr/lib/python3.10/asyncio/base_events.py", line 641, in 
run_until_complete
return future.result()
  File "/home/graingert/projects/test_foo.py", line 7, in amain
await asyncio.get_running_loop().sock_connect(sock, ("google.com", "443"))
  File "/usr/lib/python3.10/asyncio/selector_events.py", line 496, in 
sock_connect
resolved = await self._ensure_resolved(
  File "/usr/lib/python3.10/asyncio/base_events.py", line 1395, in 
_ensure_resolved
return await loop.getaddrinfo(host, port, family=family, type=type,
  File "/usr/lib/python3.10/asyncio/base_events.py", line 855, in getaddrinfo
return await self.run_in_executor(
  File "/usr/lib/python3.10/concurrent/futures/thread.py", line 58, in run
result = self.fn(*self.args, **self.kwargs)
  File "/usr/lib/python3.10/socket.py", line 955, in getaddrinfo
for res in _socket.getaddrinfo(host, port, family, type, proto, flags):
socket.gaierror: [Errno -7] ai_socktype not supported

--
components: asyncio
messages: 413709
nosy: asvetlov, graingert, yselivanov
priority: normal
severity: normal
status: open
title: asyncio SelectorEventLoop.sock_connect fails with a UDP socket
versions: Python 3.10, Python 3.11, Python 3.9

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com