[issue45693] `loop.create_server` with port=0 uses different ports for ipv4 & ipv6

2021-11-24 Thread Eric V. Smith
Change by Eric V. Smith : -- assignee: -> docs@python components: +Documentation nosy: +docs@python versions: +Python 3.11 -Python 3.8 ___ Python tracker ___

[issue45693] `loop.create_server` with port=0 uses different ports for ipv4 & ipv6

2021-11-24 Thread Eric V. Smith
Eric V. Smith added the comment: Thanks for the PR, @jcristharif. -- resolution: -> fixed stage: patch review -> resolved status: open -> closed ___ Python tracker ___

[issue45693] `loop.create_server` with port=0 uses different ports for ipv4 & ipv6

2021-11-24 Thread Eric V. Smith
Eric V. Smith added the comment: New changeset 151c9bf649a049f52df388a8f2390988949abf59 by Miss Islington (bot) in branch '3.9': bpo-45693: Document `port` parameter to `loop.create_server` (GH-29760) (GH-29763)

[issue45693] `loop.create_server` with port=0 uses different ports for ipv4 & ipv6

2021-11-24 Thread Eric V. Smith
Eric V. Smith added the comment: New changeset 8cabcde8d66bfd8abc98b862c93c66946f8514a1 by Miss Islington (bot) in branch '3.10': bpo-45693: Document `port` parameter to `loop.create_server` (GH-29760) (GH-29762)

[issue45693] `loop.create_server` with port=0 uses different ports for ipv4 & ipv6

2021-11-24 Thread miss-islington
miss-islington added the comment: New changeset d71c7bc7339eb82de493c66ebbbfa1cad250ac78 by Jim Crist-Harif in branch 'main': bpo-45693: Document `port` parameter to `loop.create_server` (GH-29760) https://github.com/python/cpython/commit/d71c7bc7339eb82de493c66ebbbfa1cad250ac78 --

[issue45693] `loop.create_server` with port=0 uses different ports for ipv4 & ipv6

2021-11-24 Thread miss-islington
Change by miss-islington : -- pull_requests: +28002 pull_request: https://github.com/python/cpython/pull/29764 ___ Python tracker ___

[issue45693] `loop.create_server` with port=0 uses different ports for ipv4 & ipv6

2021-11-24 Thread miss-islington
Change by miss-islington : -- pull_requests: +28001 pull_request: https://github.com/python/cpython/pull/29763 ___ Python tracker ___

[issue45693] `loop.create_server` with port=0 uses different ports for ipv4 & ipv6

2021-11-24 Thread miss-islington
Change by miss-islington : -- pull_requests: +28000 pull_request: https://github.com/python/cpython/pull/29762 ___ Python tracker ___

[issue45693] `loop.create_server` with port=0 uses different ports for ipv4 & ipv6

2021-11-24 Thread Jim Crist-Harif
Jim Crist-Harif added the comment: Apologies for the delay here. I've pushed a documentation patch at https://github.com/python/cpython/pull/29760. -- ___ Python tracker ___

[issue45693] `loop.create_server` with port=0 uses different ports for ipv4 & ipv6

2021-11-24 Thread Jim Crist-Harif
Change by Jim Crist-Harif : -- keywords: +patch pull_requests: +27998 stage: -> patch review pull_request: https://github.com/python/cpython/pull/29760 ___ Python tracker ___

[issue45693] `loop.create_server` with port=0 uses different ports for ipv4 & ipv6

2021-11-03 Thread Jim Crist-Harif
Jim Crist-Harif added the comment: > Is tornado the only example or you are aware of other libraries with such > behavior? A quick survey of other language network stacks didn't turn anything up, *But* I also didn't find any implementations (other than asyncio & tornado) that bind multiple

[issue45693] `loop.create_server` with port=0 uses different ports for ipv4 & ipv6

2021-11-03 Thread Andrew Svetlov
Andrew Svetlov added the comment: PR for documentation fix is appreciated. Random fails to bind the same port if free ports are available is kind of regression. Is tornado the only example or you are aware of other libraries with such behavior? --

[issue45693] `loop.create_server` with port=0 uses different ports for ipv4 & ipv6

2021-11-03 Thread Jim Crist-Harif
Jim Crist-Harif added the comment: If you decline that a change is needed here, at the very least the current behavior of `port=0` should be documented. I'd be happy to push up a fix if so. -- ___ Python tracker

[issue45693] `loop.create_server` with port=0 uses different ports for ipv4 & ipv6

2021-11-03 Thread Jim Crist-Harif
Jim Crist-Harif added the comment: > I'm not aware of an OS API call that binds both IPv4 and IPv6 to the same > random port. Sure, but `loop.create_server` is already higher-level than a single OS API call. By default `create_server` will already bind multiple sockets if `host=""`,

[issue45693] `loop.create_server` with port=0 uses different ports for ipv4 & ipv6

2021-11-03 Thread Andrew Svetlov
Andrew Svetlov added the comment: Tornado solution sounds weak; it can fail the server start if free ports are available. I concur with Eric, I'm not aware of an OS API call that binds both IPv4 and IPv6 to the same random port. -- ___ Python

[issue45693] `loop.create_server` with port=0 uses different ports for ipv4 & ipv6

2021-11-02 Thread Jim Crist-Harif
Jim Crist-Harif added the comment: Hmmm, I'd find that situation a bit surprising, but I suppose it could happen. Looks like tornado just errors, and that seems to work fine for them in practice

[issue45693] `loop.create_server` with port=0 uses different ports for ipv4 & ipv6

2021-11-02 Thread Eric V. Smith
Eric V. Smith added the comment: What do you do if a port is bound for IPv4, but is in use for IPv6? -- ___ Python tracker ___ ___

[issue45693] `loop.create_server` with port=0 uses different ports for ipv4 & ipv6

2021-11-02 Thread Jim Crist-Harif
Jim Crist-Harif added the comment: > Is there an OS interface to ensure the same port on both stacks? I don't think this is needed? Right now the code processes as: - Expand host + port + family + flags into a list of one or more tuples of socket options

[issue45693] `loop.create_server` with port=0 uses different ports for ipv4 & ipv6

2021-11-02 Thread Eric V. Smith
Eric V. Smith added the comment: Is there an OS interface to ensure the same port on both stacks? I don't know of one (although of course one might exist), in which case I don't know how you'd ensure they're both the same. -- nosy: +eric.smith

[issue45693] `loop.create_server` with port=0 uses different ports for ipv4 & ipv6

2021-11-02 Thread Jim Crist-Harif
Change by Jim Crist-Harif : -- versions: +Python 3.10, Python 3.8 ___ Python tracker ___ ___ Python-bugs-list mailing list

[issue45693] `loop.create_server` with port=0 uses different ports for ipv4 & ipv6

2021-11-02 Thread Jim Crist-Harif
New submission from Jim Crist-Harif : To create a new server with `loop.create_server` that listens on all interfaces and a random port, I'd expect passing in `host=""`, `port=0` to work (per the documentation). However, as written this results in 2 different ports being used - one for ipv4