Skip to content

Commit eb02196

Browse files
authored
bpo-11953: Extend table of Windows WSA* error codes (GH-15004)
1 parent c837ad4 commit eb02196

File tree

2 files changed

+82
-1
lines changed

2 files changed

+82
-1
lines changed

Lib/socket.py

Lines changed: 81 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -109,21 +109,101 @@ def _intenum_converter(value, enum_klass):
109109
# WSA error codes
110110
if sys.platform.lower().startswith("win"):
111111
errorTab = {}
112+
errorTab[6] = "Specified event object handle is invalid."
113+
errorTab[8] = "Insufficient memory available."
114+
errorTab[87] = "One or more parameters are invalid."
115+
errorTab[995] = "Overlapped operation aborted."
116+
errorTab[996] = "Overlapped I/O event object not in signaled state."
117+
errorTab[997] = "Overlapped operation will complete later."
112118
errorTab[10004] = "The operation was interrupted."
113119
errorTab[10009] = "A bad file handle was passed."
114120
errorTab[10013] = "Permission denied."
115-
errorTab[10014] = "A fault occurred on the network??" # WSAEFAULT
121+
errorTab[10014] = "A fault occurred on the network??" # WSAEFAULT
116122
errorTab[10022] = "An invalid operation was attempted."
123+
errorTab[10024] = "Too many open files."
117124
errorTab[10035] = "The socket operation would block"
118125
errorTab[10036] = "A blocking operation is already in progress."
126+
errorTab[10037] = "Operation already in progress."
127+
errorTab[10038] = "Socket operation on nonsocket."
128+
errorTab[10039] = "Destination address required."
129+
errorTab[10040] = "Message too long."
130+
errorTab[10041] = "Protocol wrong type for socket."
131+
errorTab[10042] = "Bad protocol option."
132+
errorTab[10043] = "Protocol not supported."
133+
errorTab[10044] = "Socket type not supported."
134+
errorTab[10045] = "Operation not supported."
135+
errorTab[10046] = "Protocol family not supported."
136+
errorTab[10047] = "Address family not supported by protocol family."
119137
errorTab[10048] = "The network address is in use."
138+
errorTab[10049] = "Cannot assign requested address."
139+
errorTab[10050] = "Network is down."
140+
errorTab[10051] = "Network is unreachable."
141+
errorTab[10052] = "Network dropped connection on reset."
142+
errorTab[10053] = "Software caused connection abort."
120143
errorTab[10054] = "The connection has been reset."
144+
errorTab[10055] = "No buffer space available."
145+
errorTab[10056] = "Socket is already connected."
146+
errorTab[10057] = "Socket is not connected."
121147
errorTab[10058] = "The network has been shut down."
148+
errorTab[10059] = "Too many references."
122149
errorTab[10060] = "The operation timed out."
123150
errorTab[10061] = "Connection refused."
151+
errorTab[10062] = "Cannot translate name."
124152
errorTab[10063] = "The name is too long."
125153
errorTab[10064] = "The host is down."
126154
errorTab[10065] = "The host is unreachable."
155+
errorTab[10066] = "Directory not empty."
156+
errorTab[10067] = "Too many processes."
157+
errorTab[10068] = "User quota exceeded."
158+
errorTab[10069] = "Disk quota exceeded."
159+
errorTab[10070] = "Stale file handle reference."
160+
errorTab[10071] = "Item is remote."
161+
errorTab[10091] = "Network subsystem is unavailable."
162+
errorTab[10092] = "Winsock.dll version out of range."
163+
errorTab[10093] = "Successful WSAStartup not yet performed."
164+
errorTab[10101] = "Graceful shutdown in progress."
165+
errorTab[10102] = "No more results from WSALookupServiceNext."
166+
errorTab[10103] = "Call has been canceled."
167+
errorTab[10104] = "Procedure call table is invalid."
168+
errorTab[10105] = "Service provider is invalid."
169+
errorTab[10106] = "Service provider failed to initialize."
170+
errorTab[10107] = "System call failure."
171+
errorTab[10108] = "Service not found."
172+
errorTab[10109] = "Class type not found."
173+
errorTab[10110] = "No more results from WSALookupServiceNext."
174+
errorTab[10111] = "Call was canceled."
175+
errorTab[10112] = "Database query was refused."
176+
errorTab[11001] = "Host not found."
177+
errorTab[11002] = "Nonauthoritative host not found."
178+
errorTab[11003] = "This is a nonrecoverable error."
179+
errorTab[11004] = "Valid name, no data record requested type."
180+
errorTab[11005] = "QoS receivers."
181+
errorTab[11006] = "QoS senders."
182+
errorTab[11007] = "No QoS senders."
183+
errorTab[11008] = "QoS no receivers."
184+
errorTab[11009] = "QoS request confirmed."
185+
errorTab[11010] = "QoS admission error."
186+
errorTab[11011] = "QoS policy failure."
187+
errorTab[11012] = "QoS bad style."
188+
errorTab[11013] = "QoS bad object."
189+
errorTab[11014] = "QoS traffic control error."
190+
errorTab[11015] = "QoS generic error."
191+
errorTab[11016] = "QoS service type error."
192+
errorTab[11017] = "QoS flowspec error."
193+
errorTab[11018] = "Invalid QoS provider buffer."
194+
errorTab[11019] = "Invalid QoS filter style."
195+
errorTab[11020] = "Invalid QoS filter style."
196+
errorTab[11021] = "Incorrect QoS filter count."
197+
errorTab[11022] = "Invalid QoS object length."
198+
errorTab[11023] = "Incorrect QoS flow count."
199+
errorTab[11024] = "Unrecognized QoS object."
200+
errorTab[11025] = "Invalid QoS policy object."
201+
errorTab[11026] = "Invalid QoS flow descriptor."
202+
errorTab[11027] = "Invalid QoS provider-specific flowspec."
203+
errorTab[11028] = "Invalid QoS provider-specific filterspec."
204+
errorTab[11029] = "Invalid QoS shape discard mode object."
205+
errorTab[11030] = "Invalid QoS shaping rate object."
206+
errorTab[11031] = "Reserved policy QoS element type."
127207
__all__.append("errorTab")
128208

129209

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Completing WSA* error codes in :mod:`socket`.

0 commit comments

Comments
 (0)