From 947c8ea3bc4240554c953396251d9a5ac2198ff4 Mon Sep 17 00:00:00 2001 From: Alexis Dauphin Date: Wed, 6 May 2026 19:52:23 +0200 Subject: [PATCH] gh-148599: Update WSA `socket` error codes (#148033) --- Lib/socket.py | 6 +++--- .../Library/2026-04-15-09-36-03.gh-issue-148599.90i1Ku.rst | 1 + 2 files changed, 4 insertions(+), 3 deletions(-) create mode 100644 Misc/NEWS.d/next/Library/2026-04-15-09-36-03.gh-issue-148599.90i1Ku.rst diff --git a/Lib/socket.py b/Lib/socket.py index 34d897a82edd..03c3fe88f15c 100644 --- a/Lib/socket.py +++ b/Lib/socket.py @@ -123,7 +123,7 @@ if sys.platform.lower().startswith("win"): 10004: "The operation was interrupted.", 10009: "A bad file handle was passed.", 10013: "Permission denied.", - 10014: "A fault occurred on the network??", + 10014: "An invalid pointer was passed.", 10022: "An invalid operation was attempted.", 10024: "Too many open files.", 10035: "The socket operation would block.", @@ -181,7 +181,7 @@ if sys.platform.lower().startswith("win"): 11001: "Host not found.", 11002: "Nonauthoritative host not found.", 11003: "This is a nonrecoverable error.", - 11004: "Valid name, no data record requested type.", + 11004: "Valid name, no data record of requested type.", 11005: "QoS receivers.", 11006: "QoS senders.", 11007: "No QoS senders.", @@ -197,7 +197,7 @@ if sys.platform.lower().startswith("win"): 11017: "QoS flowspec error.", 11018: "Invalid QoS provider buffer.", 11019: "Invalid QoS filter style.", - 11020: "Invalid QoS filter style.", + 11020: "Invalid QoS filter type.", 11021: "Incorrect QoS filter count.", 11022: "Invalid QoS object length.", 11023: "Incorrect QoS flow count.", diff --git a/Misc/NEWS.d/next/Library/2026-04-15-09-36-03.gh-issue-148599.90i1Ku.rst b/Misc/NEWS.d/next/Library/2026-04-15-09-36-03.gh-issue-148599.90i1Ku.rst new file mode 100644 index 000000000000..eb76b3358aa0 --- /dev/null +++ b/Misc/NEWS.d/next/Library/2026-04-15-09-36-03.gh-issue-148599.90i1Ku.rst @@ -0,0 +1 @@ +Update the :mod:`socket` module's WSA error messages to match official documentation. -- 2.47.3