[issue33921] Explain that '' can be used to bind to all interfaces for the AF_INET address family in the docs
![](https://secure.gravatar.com/avatar/fa0f7819f1825f596b384c19aa7dcf33.jpg?s=120&d=mm&r=g)
New submission from John Hagen <johnthagen@gmail.com>: The socket documentation (https://docs.python.org/3/library/socket.html#socket-families) does not list '' as a way to bind to all interfaces for the AF_INET/AF_INET6 address family. This is answered on SO here: https://stackoverflow.com/a/8034146 but it took me a while to find it. Ideally if this was mentioned in the docs, that would be great. ---------- assignee: docs@python components: Documentation messages: 320125 nosy: John Hagen, docs@python priority: normal severity: normal status: open title: Explain that '' can be used to bind to all interfaces for the AF_INET address family in the docs type: enhancement versions: Python 3.5, Python 3.6, Python 3.7, Python 3.8 _______________________________________ Python tracker <report@bugs.python.org> <https://bugs.python.org/issue33921> _______________________________________
![](https://secure.gravatar.com/avatar/fa0f7819f1825f596b384c19aa7dcf33.jpg?s=120&d=mm&r=g)
Ammar Askar <ammar@ammaraskar.com> added the comment: It's kinda mentioned: "For IPv4 addresses, two special forms are accepted instead of a host address: the empty string represents INADDR_ANY" Though it could be more explicit on what means since binding to all interfaces is a common use case. ---------- nosy: +ammar2 _______________________________________ Python tracker <report@bugs.python.org> <https://bugs.python.org/issue33921> _______________________________________
![](https://secure.gravatar.com/avatar/fa0f7819f1825f596b384c19aa7dcf33.jpg?s=120&d=mm&r=g)
John Hagen <johnthagen@gmail.com> added the comment: @ammar2 I see that now. Yeah it's further down in the docs and doesn't actually call out '' like is done for AF_CAN: A tuple (interface, ) is used for the AF_CAN address family, where interface is a string representing a network interface name like 'can0'. The network interface name '' can be used to receive packets from all network interfaces of this family. Ideally I think putting something in this section would be helpful: A pair (host, port) is used for the AF_INET address family, where host is a string representing either a hostname in Internet domain notation like 'daring.cwi.nl' or an IPv4 address like '100.50.200.5', and port is an integer. ---------- _______________________________________ Python tracker <report@bugs.python.org> <https://bugs.python.org/issue33921> _______________________________________
![](https://secure.gravatar.com/avatar/fa0f7819f1825f596b384c19aa7dcf33.jpg?s=120&d=mm&r=g)
Ned Deily <nad@python.org> added the comment: John, since you raised the issue, would you like to provide a doc PR? ---------- keywords: +easy nosy: +ned.deily stage: -> needs patch versions: -Python 3.5 _______________________________________ Python tracker <report@bugs.python.org> <https://bugs.python.org/issue33921> _______________________________________
![](https://secure.gravatar.com/avatar/fa0f7819f1825f596b384c19aa7dcf33.jpg?s=120&d=mm&r=g)
Change by Roundup Robot <devnull@psf.upfronthosting.co.za>: ---------- keywords: +patch pull_requests: +7484 stage: needs patch -> patch review _______________________________________ Python tracker <report@bugs.python.org> <https://bugs.python.org/issue33921> _______________________________________
![](https://secure.gravatar.com/avatar/fa0f7819f1825f596b384c19aa7dcf33.jpg?s=120&d=mm&r=g)
Christian Heimes <lists@cheimes.de> added the comment: New changeset 95dfb9c3aefdc981d23af700b753a6c97159ccad by Christian Heimes (johnthagen) in branch 'master': bpo-33921: Clarify how to bind to all interfaces using socket (GH-7877) https://github.com/python/cpython/commit/95dfb9c3aefdc981d23af700b753a6c9715... ---------- nosy: +christian.heimes _______________________________________ Python tracker <report@bugs.python.org> <https://bugs.python.org/issue33921> _______________________________________
![](https://secure.gravatar.com/avatar/fa0f7819f1825f596b384c19aa7dcf33.jpg?s=120&d=mm&r=g)
Change by miss-islington <mariatta.wijaya+miss-islington@gmail.com>: ---------- pull_requests: +8030 _______________________________________ Python tracker <report@bugs.python.org> <https://bugs.python.org/issue33921> _______________________________________
![](https://secure.gravatar.com/avatar/fa0f7819f1825f596b384c19aa7dcf33.jpg?s=120&d=mm&r=g)
Change by miss-islington <mariatta.wijaya+miss-islington@gmail.com>: ---------- pull_requests: +8031 _______________________________________ Python tracker <report@bugs.python.org> <https://bugs.python.org/issue33921> _______________________________________
![](https://secure.gravatar.com/avatar/fa0f7819f1825f596b384c19aa7dcf33.jpg?s=120&d=mm&r=g)
miss-islington <mariatta.wijaya+miss-islington@gmail.com> added the comment: New changeset 23355445625b8b41030dbda9decaf2f4aa7035a6 by Miss Islington (bot) in branch '3.7': bpo-33921: Clarify how to bind to all interfaces using socket (GH-7877) https://github.com/python/cpython/commit/23355445625b8b41030dbda9decaf2f4aa7... ---------- nosy: +miss-islington _______________________________________ Python tracker <report@bugs.python.org> <https://bugs.python.org/issue33921> _______________________________________
![](https://secure.gravatar.com/avatar/fa0f7819f1825f596b384c19aa7dcf33.jpg?s=120&d=mm&r=g)
miss-islington <mariatta.wijaya+miss-islington@gmail.com> added the comment: New changeset 30f295b85ece2dc2b2b65018bd15090efa1de7dc by Miss Islington (bot) in branch '3.6': bpo-33921: Clarify how to bind to all interfaces using socket (GH-7877) https://github.com/python/cpython/commit/30f295b85ece2dc2b2b65018bd15090efa1... ---------- _______________________________________ Python tracker <report@bugs.python.org> <https://bugs.python.org/issue33921> _______________________________________
![](https://secure.gravatar.com/avatar/fa0f7819f1825f596b384c19aa7dcf33.jpg?s=120&d=mm&r=g)
Change by Steve Dower <steve.dower@python.org>: ---------- resolution: -> fixed stage: patch review -> resolved status: open -> closed _______________________________________ Python tracker <report@bugs.python.org> <https://bugs.python.org/issue33921> _______________________________________
participants (7)
-
Ammar Askar
-
Christian Heimes
-
John Hagen
-
miss-islington
-
Ned Deily
-
Roundup Robot
-
Steve Dower