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: Add AF_LOCAL alias for AF_UNIX
Type: enhancement Stage: resolved
Components: Library (Lib) Versions: Python 3.9
process
Status: closed Resolution: rejected
Dependencies: Superseder:
Assigned To: Nosy List: christian.heimes, frosty00
Priority: normal Keywords: patch

Created on 2019-06-04 15:05 by frosty00, last changed 2022-04-11 14:59 by admin. This issue is now closed.

Pull Requests
URL Status Linked Edit
PR 13810 closed frosty00, 2019-06-04 15:12
Messages (4)
msg344585 - (view) Author: carlo (frosty00) Date: 2019-06-04 15:05
both mean the same thing and are used to reference local socket files

if you do a `man socket`

one of the lines says

PF_LOCAL        Host-internal protocols, formerly called PF_UNIX,

(AF and PF mean the same thing here, but importantly it shows that PF_UNIX has been depreciated)

this change gives users the option to type socket.AF_LOCAL as well as socket.AF_UNIX when specifying the address family for the socket.

this is my first issue so lmk if there is anything I'm missing )
msg344637 - (view) Author: Christian Heimes (christian.heimes) * (Python committer) Date: 2019-06-04 20:08
The socket type is known as AF_UNIX, AF_LOCAL, Unix domain socket, and IPC (inter process communication) socket. The man page unix(7) http://man7.org/linux/man-pages/man7/unix.7.html uses three of those four terms to explain the socket type:

    The AF_UNIX (also known as AF_LOCAL) socket family is used to
    communicate between processes on the same machine efficiently.
    Traditionally, UNIX domain sockets can be [...]

The strace command also uses the name AF_UNIX and not AF_LOCAL. HTTP over AF_UNIX often uses http+unix:// or unix:// to refer to a socket file.

I'm -1 to add the alias. It just adds to the confusion. It's also against the Zen of Python: "There should be one-- and preferably only one --obvious way to do it."
msg344736 - (view) Author: carlo (frosty00) Date: 2019-06-05 15:36
> I'm -1 to add the alias. It just adds to the confusion. It's also against the Zen of Python: "There should be one-- and preferably only one --obvious way to do it."

Agreed with the zen of python.

This is my first PR / issue, thanks for the fast reply.

You may close this issue )
msg344738 - (view) Author: Christian Heimes (christian.heimes) * (Python committer) Date: 2019-06-05 15:39
You are welcome! :)
History
Date User Action Args
2022-04-11 14:59:16adminsetgithub: 81333
2019-06-05 15:39:27christian.heimessetstatus: open -> closed
type: enhancement
messages: + msg344738

resolution: rejected
stage: patch review -> resolved
2019-06-05 15:36:57frosty00setmessages: + msg344736
2019-06-04 20:08:49christian.heimessetnosy: + christian.heimes

messages: + msg344637
versions: + Python 3.9, - Python 3.7
2019-06-04 15:12:27frosty00setkeywords: + patch
stage: patch review
pull_requests: + pull_request13695
2019-06-04 15:05:38frosty00create