This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

classification
Title: Allow ipaddres.IPv4/v6Address in asyncio.create_server
Type: enhancement Stage: patch review
Components: asyncio Versions: Python 3.10, Python 3.9, Python 3.8
process
Status: open Resolution:
Dependencies: Superseder:
Assigned To: Nosy List: DamlaAltun, asvetlov, bassford, methane, remi.lapeyre, yselivanov
Priority: normal Keywords: patch

Created on 2018-10-18 16:28 by bassford, last changed 2022-04-11 14:59 by admin.

Pull Requests
URL Status Linked Edit
PR 9956 closed DamlaAltun, 2018-10-18 19:07
PR 17434 open remi.lapeyre, 2020-06-06 21:13
Messages (6)
msg327984 - (view) Author: Ken Bassford (bassford) Date: 2018-10-18 16:28
Found that when using the following function ...

"asyncio.start_server(self.processCmd, serverhost, serverport, loop=self.loop)"

If 'serverhost' is formatted as a ipaddress.IPv4Address() it will cause a very messy failure.

Formatting 'serverhost' as a string eliminates the problem, though I suspect that asyncio developers would/should accept IPv4/IPv6 objects, in addition to strings, as the host parameter.
msg327991 - (view) Author: Andrew Svetlov (asvetlov) * (Python committer) Date: 2018-10-18 17:49
It could be a nice feature but I imagine about adding ipaddress objects support to all python APIs.
It could be done in a similar way as pathlib integration (os.fspath() and family).
msg327992 - (view) Author: DamlaAltun (DamlaAltun) * Date: 2018-10-18 17:54
Working on it.
msg327999 - (view) Author: Andrew Svetlov (asvetlov) * (Python committer) Date: 2018-10-18 19:28
I mean if we implement something like PathLike [1] but for IP addresses to socket module and teach all socket APIs to accept IPLike objects along with str -- no asyncio change is required.

1. https://docs.python.org/3/library/os.html#os.PathLike
msg370853 - (view) Author: Rémi Lapeyre (remi.lapeyre) * Date: 2020-06-06 21:13
Issue 38952 is a duplicate of this.
msg371330 - (view) Author: Inada Naoki (methane) * (Python committer) Date: 2020-06-12 04:12
I feel ABC is too much for just single dunder method.
History
Date User Action Args
2022-04-11 14:59:07adminsetgithub: 79200
2020-06-12 04:12:00methanesetnosy: + methane
messages: + msg371330
2020-06-06 21:13:26remi.lapeyresetversions: + Python 3.9, Python 3.10
nosy: + remi.lapeyre

messages: + msg370853
pull_requests: + pull_request19896
2018-10-19 21:17:09terry.reedysettitle: Minor Bug found in asyncio - Python 3.5.3 -> Allow ipaddres.IPv4/v6Address in asyncio.create_server
2018-10-19 21:15:57terry.reedysettype: behavior -> enhancement
versions: + Python 3.8, - Python 3.5
2018-10-18 19:28:49asvetlovsetmessages: + msg327999
2018-10-18 19:07:28DamlaAltunsetkeywords: + patch
stage: patch review
pull_requests: + pull_request9303
2018-10-18 17:54:13DamlaAltunsetnosy: + DamlaAltun
messages: + msg327992
2018-10-18 17:49:42asvetlovsetmessages: + msg327991
2018-10-18 16:28:24bassfordcreate