bpo-45351: Print all addresses#28828
bpo-45351: Print all addresses#28828vstinner merged 3 commits intopython:mainfrom OlafvdSpek:patch-1
Conversation
|
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 MissingOur records indicate the following people have not signed the CLA: 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 You can check yourself to see if the CLA has been received. Thanks again for the contribution, we look forward to reviewing it! |
Doc/library/asyncio-stream.rst
Outdated
|
|
||
| addr = server.sockets[0].getsockname() | ||
| print(f'Serving on {addr}') | ||
| addr = ', '.join(str(sock.getsockname()) for sock in server.sockets) |
There was a problem hiding this comment.
Why str() here? For None values? If so I'd prefer:
', '.join(sock.getsockname() for sock in server.sockets if sock.getsockname())to avoid printing "None" but I don't like the double call to getsockname, maybe:
', '.join(name for sock in server.sockets if (name := sock.getsockname()))?
There was a problem hiding this comment.
TypeError: sequence item 0: expected str instance, tuple found
There was a problem hiding this comment.
The name depends on the address family. It could also be bytes. https://bugs.python.org/issue17683
str() seems safest.
There was a problem hiding this comment.
The name depends on the address family. It could also be bytes. https://bugs.python.org/issue17683
It's a tuple.
There was a problem hiding this comment.
The variable name should be plural. Maybe addrs?
vstinner
left a comment
There was a problem hiding this comment.
LGTM but please rename the variable to addrs, as @ericvsmith suggested.
|
Thanks @OlafvdSpek for the PR, and @vstinner for merging it 🌮🎉.. I'm working now to backport this PR to: 3.9. |
|
Thanks @OlafvdSpek for the PR, and @vstinner for merging it 🌮🎉.. I'm working now to backport this PR to: 3.10. |
…ythonGH-28828) (cherry picked from commit 659812b) Co-authored-by: Olaf van der Spek <olafvdspek@gmail.com>
|
GH-28879 is a backport of this pull request to the 3.9 branch. |
…ythonGH-28828) (cherry picked from commit 659812b) Co-authored-by: Olaf van der Spek <olafvdspek@gmail.com>
|
GH-28880 is a backport of this pull request to the 3.10 branch. |
https://bugs.python.org/issue45351