Marco Ricci commited on 2025-12-17 14:04:14
Zeige 7 geänderte Dateien mit 48 Einfügungen und 37 Löschungen.
The formal name for the named pipe facility on The Annoying OS is "Windows named pipe", and this is the name other developers will expect. Thus, for reasons of clarity, we now strictly refer to them as such, i.e., refer to them as "Windows named pipes" and not "The Annoying OS named pipes". Old names still using the "Annoying OS named pipe" moniker have been adapted accordingly; in particular, this includes the former `WarnMsgTemplate.NO_ANNOYING_OS_NAMED_PIPES` symbol. By a similar token, the machine-local network socket mechanism on POSIX systems is formally called "UNIX domain sockets". For reasons of clarity, we now refer to them as such, and not by their C constant name `AF_UNIX` (or "AfUnix", or similar). Old names have been adapted accordingly; in particular, this includes the former `WarnMsgTemplate.NO_AF_UNIX` symbol.
| ... | ... |
@@ -495,7 +495,8 @@ The <b>derivepassphrase vault</b> utility exits 0 on success, and >0 if an error |
| 495 | 495 |
The <i>vault</i>(1) legacy editor interface is in use, which carries a high risk of accidentally losing or corrupting the old notes because a notes editing session cannot be aborted mid-editing. |
| 496 | 496 |
To guard against such accidental data loss, a backup copy of the old notes was saved to the <b>derivepassphrase</b> configuration directory. |
| 497 | 497 |
|
| 498 |
-<!-- Message-ID: WarnMsgTemplate.NO_AF_UNIX --> |
|
| 498 |
+<!-- Message-ID: WarnMsgTemplate.NO_UNIX_DOMAIN_SOCKETS --> |
|
| 499 |
+<!-- Message-ID (mark only): WarnMsgTemplate.NO_AF_UNIX --> |
|
| 499 | 500 |
??? warning "`Cannot connect to an SSH agent via UNIX domain sockets because this Python version does not support them.`" |
| 500 | 501 |
|
| 501 | 502 |
[Since v0.6.] |
| ... | ... |
@@ -503,7 +504,8 @@ The <b>derivepassphrase vault</b> utility exits 0 on success, and >0 if an error |
| 503 | 504 |
(Only appears together with the error message "Cannot connect to an SSH agent because this Python version does not support communicating with it.". |
| 504 | 505 |
Other, similar messages about unsupported communication mechanisms may precede the error message.) |
| 505 | 506 |
|
| 506 |
-<!-- Message-ID: WarnMsgTemplate.NO_ANNOYING_OS_NAMED_PIPES --> |
|
| 507 |
+<!-- Message-ID: WarnMsgTemplate.NO_WINDOWS_NAMED_PIPES --> |
|
| 508 |
+<!-- Message-ID (mark only): WarnMsgTemplate.NO_ANNOYING_OS_NAMED_PIPES --> |
|
| 507 | 509 |
??? warning "`Cannot connect to an SSH agent via Windows named pipes because this Python version does not support them.`" |
| 508 | 510 |
|
| 509 | 511 |
[Since v0.6.] |
| ... | ... |
@@ -1025,8 +1025,8 @@ notes was saved to the |
| 1025 | 1025 |
.Nm derivepassphrase |
| 1026 | 1026 |
configuration directory. |
| 1027 | 1027 |
. |
| 1028 |
-.\" Message-ID: WarnMsgTemplate.NO_AF_UNIX |
|
| 1029 |
-.\" Message-ID (mark only): ErrMsgTemplate.NO_AF_UNIX |
|
| 1028 |
+.\" Message-ID: WarnMsgTemplate.NO_UNIX_DOMAIN_SOCKETS |
|
| 1029 |
+.\" Message-ID (mark only): WarnMsgTemplate.NO_AF_UNIX |
|
| 1030 | 1030 |
.It Cannot connect to an SSH agent via UNIX domain sockets because this Python version does not support them. |
| 1031 | 1031 |
We attempted to use |
| 1032 | 1032 |
.Tn UNIX |
| ... | ... |
@@ -1042,7 +1042,8 @@ Other, similar messages about unsupported communication mechanisms may |
| 1042 | 1042 |
precede the error message. |
| 1043 | 1043 |
.Pc |
| 1044 | 1044 |
. |
| 1045 |
-.\" Message-ID: WarnMsgTemplate.NO_ANNOYING_OS_NAMED_PIPES |
|
| 1045 |
+.\" Message-ID: WarnMsgTemplate.NO_WINDOWS_NAMED_PIPES |
|
| 1046 |
+.\" Message-ID (mark only): WarnMsgTemplate.NO_ANNOYING_OS_NAMED_PIPES |
|
| 1046 | 1047 |
.It Cannot connect to an SSH agent via Windows named pipes because this Python version does not support them. |
| 1047 | 1048 |
We attempted to use |
| 1048 | 1049 |
.Tn Windows |
| ... | ... |
@@ -741,16 +741,20 @@ def handle_notimplementederror( |
| 741 | 741 |
""" # noqa: DOC201 |
| 742 | 742 |
|
| 743 | 743 |
def handle_notimplementederror(excgroup: BaseExceptionGroup) -> NoReturn: |
| 744 |
- if excgroup.subgroup(socketprovider.AfUnixNotAvailableError): |
|
| 744 |
+ if excgroup.subgroup( |
|
| 745 |
+ socketprovider.UnixDomainSocketsNotAvailableError |
|
| 746 |
+ ): |
|
| 745 | 747 |
warning_callback( |
| 746 |
- _msg.TranslatedString(_msg.WarnMsgTemplate.NO_AF_UNIX) |
|
| 748 |
+ _msg.TranslatedString( |
|
| 749 |
+ _msg.WarnMsgTemplate.NO_UNIX_DOMAIN_SOCKETS |
|
| 750 |
+ ) |
|
| 747 | 751 |
) |
| 748 | 752 |
if excgroup.subgroup( |
| 749 |
- socketprovider.TheAnnoyingOsNamedPipesNotAvailableError |
|
| 753 |
+ socketprovider.WindowsNamedPipesNotAvailableError |
|
| 750 | 754 |
): |
| 751 | 755 |
warning_callback( |
| 752 | 756 |
_msg.TranslatedString( |
| 753 |
- _msg.WarnMsgTemplate.NO_ANNOYING_OS_NAMED_PIPES |
|
| 757 |
+ _msg.WarnMsgTemplate.NO_WINDOWS_NAMED_PIPES |
|
| 754 | 758 |
) |
| 755 | 759 |
) |
| 756 | 760 |
error_callback( |
| ... | ... |
@@ -1953,7 +1953,7 @@ class WarnMsgTemplate(enum.Enum): |
| 1953 | 1953 |
"aborting mid-edit, and because the notes were actually changed.", |
| 1954 | 1954 |
flags="python-brace-format", |
| 1955 | 1955 |
) |
| 1956 |
- NO_AF_UNIX = commented( |
|
| 1956 |
+ NO_UNIX_DOMAIN_SOCKETS = commented( |
|
| 1957 | 1957 |
"", |
| 1958 | 1958 |
)( |
| 1959 | 1959 |
"Warning message", |
| ... | ... |
@@ -1961,7 +1961,7 @@ class WarnMsgTemplate(enum.Enum): |
| 1961 | 1961 |
"because this Python version does not support them.", |
| 1962 | 1962 |
) |
| 1963 | 1963 |
"""""" |
| 1964 |
- NO_ANNOYING_OS_NAMED_PIPES = commented( |
|
| 1964 |
+ NO_WINDOWS_NAMED_PIPES = commented( |
|
| 1965 | 1965 |
"", |
| 1966 | 1966 |
)( |
| 1967 | 1967 |
"Warning message", |
| ... | ... |
@@ -24,11 +24,17 @@ class NoSuchProviderError(KeyError): |
| 24 | 24 |
"""No such SSH agent socket provider is known.""" |
| 25 | 25 |
|
| 26 | 26 |
|
| 27 |
-class AfUnixNotAvailableError(NotImplementedError): |
|
| 28 |
- """This Python installation does not support socket.AF_UNIX.""" |
|
| 27 |
+class UnixDomainSocketsNotAvailableError(NotImplementedError): |
|
| 28 |
+ """This Python installation does not support UNIX domain sockets. |
|
| 29 | 29 |
|
| 30 |
+ On this installation, the standard library symbol |
|
| 31 |
+ [`socket.AF_UNIX`][] is not available, necessary to create UNIX |
|
| 32 |
+ domain sockets. |
|
| 30 | 33 |
|
| 31 |
-class TheAnnoyingOsNamedPipesNotAvailableError(NotImplementedError): |
|
| 34 |
+ """ |
|
| 35 |
+ |
|
| 36 |
+ |
|
| 37 |
+class WindowsNamedPipesNotAvailableError(NotImplementedError): |
|
| 32 | 38 |
"""This Python installation does not support Windows named pipes.""" |
| 33 | 39 |
|
| 34 | 40 |
|
| ... | ... |
@@ -52,13 +58,11 @@ class SocketProvider: |
| 52 | 58 |
Raises: |
| 53 | 59 |
KeyError: |
| 54 | 60 |
The `SSH_AUTH_SOCK` environment variable was not found. |
| 55 |
- AfUnixNotAvailableError: |
|
| 56 |
- [This Python version does not support UNIX domain |
|
| 57 |
- sockets][AF_UNIX], necessary to automatically connect to |
|
| 61 |
+ UnixDomainSocketsNotAvailableError: |
|
| 62 |
+ This Python version does not support UNIX domain |
|
| 63 |
+ sockets, necessary to automatically connect to |
|
| 58 | 64 |
a running SSH agent via the `SSH_AUTH_SOCK` environment |
| 59 | 65 |
variable. |
| 60 |
- |
|
| 61 |
- [AF_UNIX]: https://docs.python.org/3/library/socket.html#socket.AF_UNIX |
|
| 62 | 66 |
OSError: |
| 63 | 67 |
There was an error setting up a socket connection to the |
| 64 | 68 |
agent. |
| ... | ... |
@@ -66,7 +70,7 @@ class SocketProvider: |
| 66 | 70 |
""" |
| 67 | 71 |
if not hasattr(socket, "AF_UNIX"): |
| 68 | 72 |
msg = "This Python version does not support UNIX domain sockets." |
| 69 |
- raise AfUnixNotAvailableError(msg) |
|
| 73 |
+ raise UnixDomainSocketsNotAvailableError(msg) |
|
| 70 | 74 |
else: # noqa: RET506 # pragma: unless posix no cover |
| 71 | 75 |
sock = socket.socket(family=socket.AF_UNIX) |
| 72 | 76 |
if "SSH_AUTH_SOCK" not in os.environ: |
| ... | ... |
@@ -78,7 +82,7 @@ class SocketProvider: |
| 78 | 82 |
return sock |
| 79 | 83 |
|
| 80 | 84 |
@staticmethod |
| 81 |
- def the_annoying_os_named_pipes() -> _types.SSHAgentSocket: |
|
| 85 |
+ def windows_named_pipe() -> _types.SSHAgentSocket: |
|
| 82 | 86 |
"""Return a socket connected to Pageant/OpenSSH on The Annoying OS. |
| 83 | 87 |
|
| 84 | 88 |
This may be a write-through socket if the underlying connection |
| ... | ... |
@@ -86,7 +90,7 @@ class SocketProvider: |
| 86 | 90 |
communicate. |
| 87 | 91 |
|
| 88 | 92 |
Raises: |
| 89 |
- TheAnnoyingOsNamedPipesNotAvailableError: |
|
| 93 |
+ WindowsNamedPipesNotAvailableError: |
|
| 90 | 94 |
This functionality is not implemented yet. |
| 91 | 95 |
|
| 92 | 96 |
Warning: Not implemented yet |
| ... | ... |
@@ -100,7 +104,7 @@ class SocketProvider: |
| 100 | 104 |
""" |
| 101 | 105 |
if not hasattr(ctypes, "WinDLL"): |
| 102 | 106 |
msg = "This Python version does not support Windows named pipes." |
| 103 |
- raise TheAnnoyingOsNamedPipesNotAvailableError(msg) |
|
| 107 |
+ raise WindowsNamedPipesNotAvailableError(msg) |
|
| 104 | 108 |
else: # noqa: RET506 # pragma: unless the-annoying-os no cover |
| 105 | 109 |
msg = ( |
| 106 | 110 |
"Communicating with Pageant or OpenSSH on Windows " |
| ... | ... |
@@ -338,7 +342,7 @@ class SocketProvider: |
| 338 | 342 |
|
| 339 | 343 |
SocketProvider.registry.update({
|
| 340 | 344 |
"posix": SocketProvider.unix_domain_ssh_auth_sock, |
| 341 |
- "the_annoying_os": SocketProvider.the_annoying_os_named_pipes, |
|
| 345 |
+ "the_annoying_os": SocketProvider.windows_named_pipe, |
|
| 342 | 346 |
# known instances |
| 343 | 347 |
"stub_agent": None, |
| 344 | 348 |
"stub_with_address": None, |
| ... | ... |
@@ -356,8 +356,8 @@ the_annoying_os_entry = _types.SSHAgentSocketProviderEntry( |
| 356 | 356 |
(), |
| 357 | 357 |
) |
| 358 | 358 |
""" |
| 359 |
-The standard [`_types.SSHAgentSocketProviderEntry`][] for the named pipe |
|
| 360 |
-handler on The Annoying Operating System. |
|
| 359 |
+The standard [`_types.SSHAgentSocketProviderEntry`][] for the Windows |
|
| 360 |
+named pipe handler on The Annoying Operating System. |
|
| 361 | 361 |
""" |
| 362 | 362 |
|
| 363 | 363 |
faulty_entry_callable = _types.SSHAgentSocketProviderEntry( |
| ... | ... |
@@ -199,24 +199,24 @@ class SocketAddressAction(str, enum.Enum): |
| 199 | 199 |
"""Test fixture settings for the SSH agent socket address. |
| 200 | 200 |
|
| 201 | 201 |
Attributes: |
| 202 |
- MANGLE_ANNOYING_OS_NAMED_PIPE: |
|
| 203 |
- Mangle the address for the Annoying OS named pipe endpoint. |
|
| 202 |
+ MANGLE_WINDOWS_NAMED_PIPE: |
|
| 203 |
+ Mangle the address for the Windows named pipe endpoint. |
|
| 204 | 204 |
MANGLE_SSH_AUTH_SOCK: |
| 205 | 205 |
Mangle the address for the UNIX domain socket (the |
| 206 | 206 |
`SSH_AUTH_SOCK` environment variable). |
| 207 |
- UNSET_ANNOYING_OS_NAMED_PIPE: |
|
| 208 |
- Unset the address for the Annoying OS named pipe endpoint. |
|
| 207 |
+ UNSET_WINDOWS_NAMED_PIPE: |
|
| 208 |
+ Unset the address for the Windows named pipe endpoint. |
|
| 209 | 209 |
UNSET_SSH_AUTH_SOCK: |
| 210 | 210 |
Unset the `SSH_AUTH_SOCK` environment variable (the address |
| 211 | 211 |
for the UNIX domain socket). |
| 212 | 212 |
|
| 213 | 213 |
""" |
| 214 | 214 |
|
| 215 |
- MANGLE_ANNOYING_OS_NAMED_PIPE = enum.auto() |
|
| 215 |
+ MANGLE_WINDOWS_NAMED_PIPE = enum.auto() |
|
| 216 | 216 |
"""""" |
| 217 | 217 |
MANGLE_SSH_AUTH_SOCK = enum.auto() |
| 218 | 218 |
"""""" |
| 219 |
- UNSET_ANNOYING_OS_NAMED_PIPE = enum.auto() |
|
| 219 |
+ UNSET_WINDOWS_NAMED_PIPE = enum.auto() |
|
| 220 | 220 |
"""""" |
| 221 | 221 |
UNSET_SSH_AUTH_SOCK = enum.auto() |
| 222 | 222 |
"""""" |
| ... | ... |
@@ -229,8 +229,8 @@ class SocketAddressAction(str, enum.Enum): |
| 229 | 229 |
# matching. |
| 230 | 230 |
# https://the13thletter.info/derivepassphrase/latest/pycompatibility/#after-eol-py3.9 |
| 231 | 231 |
if self in {
|
| 232 |
- self.MANGLE_ANNOYING_OS_NAMED_PIPE, |
|
| 233 |
- self.UNSET_ANNOYING_OS_NAMED_PIPE, |
|
| 232 |
+ self.MANGLE_WINDOWS_NAMED_PIPE, |
|
| 233 |
+ self.UNSET_WINDOWS_NAMED_PIPE, |
|
| 234 | 234 |
}: # pragma: no cover [unused] |
| 235 | 235 |
pass |
| 236 | 236 |
elif self == self.MANGLE_SSH_AUTH_SOCK: |
| ... | ... |
@@ -260,10 +260,10 @@ class SystemSupportAction(str, enum.Enum): |
| 260 | 260 |
UNSET_PROVIDER_LIST: |
| 261 | 261 |
Ensure an empty list of SSH agent socket providers. |
| 262 | 262 |
UNSET_WINDLL: |
| 263 |
- Ensure lack of support for The Annoying OS named pipes. |
|
| 263 |
+ Ensure lack of support for Windows named pipes. |
|
| 264 | 264 |
UNSET_WINDLL_AND_ENSURE_USE: |
| 265 |
- Ensure lack of support for The Annoying OS named pipes, and |
|
| 266 |
- that the agent will use this socket provider. |
|
| 265 |
+ Ensure lack of support for Windows named pipes, and that the |
|
| 266 |
+ agent will use this socket provider. |
|
| 267 | 267 |
|
| 268 | 268 |
""" |
| 269 | 269 |
|
| 270 | 270 |