Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
C
cpython
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
cpython
Commits
0c6fec79
Commit
0c6fec79
authored
Dec 18, 2012
by
Andrew Svetlov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Issue #16717: get rid of socket.error, replace with OSError
parent
85b4335b
Changes
39
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
39 changed files
with
169 additions
and
167 deletions
+169
-167
Doc/library/nntplib.rst
Doc/library/nntplib.rst
+1
-2
Lib/asynchat.py
Lib/asynchat.py
+2
-2
Lib/asyncore.py
Lib/asyncore.py
+9
-9
Lib/distutils/command/upload.py
Lib/distutils/command/upload.py
+1
-1
Lib/ftplib.py
Lib/ftplib.py
+4
-4
Lib/http/client.py
Lib/http/client.py
+2
-2
Lib/idlelib/PyShell.py
Lib/idlelib/PyShell.py
+1
-1
Lib/idlelib/rpc.py
Lib/idlelib/rpc.py
+4
-4
Lib/idlelib/run.py
Lib/idlelib/run.py
+2
-2
Lib/imaplib.py
Lib/imaplib.py
+4
-4
Lib/logging/config.py
Lib/logging/config.py
+1
-1
Lib/logging/handlers.py
Lib/logging/handlers.py
+4
-4
Lib/nntplib.py
Lib/nntplib.py
+1
-1
Lib/platform.py
Lib/platform.py
+1
-1
Lib/poplib.py
Lib/poplib.py
+1
-1
Lib/smtpd.py
Lib/smtpd.py
+2
-2
Lib/socketserver.py
Lib/socketserver.py
+2
-2
Lib/ssl.py
Lib/ssl.py
+6
-4
Lib/telnetlib.py
Lib/telnetlib.py
+1
-1
Lib/test/ssl_servers.py
Lib/test/ssl_servers.py
+1
-1
Lib/test/support.py
Lib/test/support.py
+3
-3
Lib/test/test_asyncore.py
Lib/test/test_asyncore.py
+3
-3
Lib/test/test_epoll.py
Lib/test/test_epoll.py
+1
-1
Lib/test/test_ftplib.py
Lib/test/test_ftplib.py
+3
-3
Lib/test/test_httplib.py
Lib/test/test_httplib.py
+2
-2
Lib/test/test_kqueue.py
Lib/test/test_kqueue.py
+1
-1
Lib/test/test_logging.py
Lib/test/test_logging.py
+4
-4
Lib/test/test_nntplib.py
Lib/test/test_nntplib.py
+1
-1
Lib/test/test_poplib.py
Lib/test/test_poplib.py
+1
-1
Lib/test/test_smtplib.py
Lib/test/test_smtplib.py
+1
-1
Lib/test/test_socket.py
Lib/test/test_socket.py
+56
-56
Lib/test/test_ssl.py
Lib/test/test_ssl.py
+14
-14
Lib/test/test_urllib2.py
Lib/test/test_urllib2.py
+2
-2
Lib/test/test_xmlrpc.py
Lib/test/test_xmlrpc.py
+14
-14
Lib/test/test_xmlrpc_net.py
Lib/test/test_xmlrpc_net.py
+2
-2
Lib/urllib/request.py
Lib/urllib/request.py
+6
-6
Lib/webbrowser.py
Lib/webbrowser.py
+1
-1
Lib/xmlrpc/client.py
Lib/xmlrpc/client.py
+3
-2
Modules/socketmodule.c
Modules/socketmodule.c
+1
-1
No files found.
Doc/library/nntplib.rst
View file @
0c6fec79
:mod:`nntplib` --- NNTP protocol client
=======================================
...
...
@@ -71,7 +70,7 @@ The module itself defines the following classes:
reader-specific commands, such as ``group``. If you get unexpected
:exc:`NNTPPermanentError`\ s, you might need to set *readermode*.
:class:`NNTP` class supports the :keyword:`with` statement to
unconditionally consume :exc:`
socket.e
rror` exceptions and to close the NNTP
unconditionally consume :exc:`
OSE
rror` exceptions and to close the NNTP
connection when done. Here is a sample on how using it:
>>> from nntplib import NNTP
...
...
Lib/asynchat.py
View file @
0c6fec79
...
...
@@ -114,7 +114,7 @@ class async_chat (asyncore.dispatcher):
try
:
data
=
self
.
recv
(
self
.
ac_in_buffer_size
)
except
socket
.
e
rror
as
why
:
except
OSE
rror
as
why
:
self
.
handle_error
()
return
...
...
@@ -243,7 +243,7 @@ class async_chat (asyncore.dispatcher):
# send the data
try
:
num_sent
=
self
.
send
(
data
)
except
socket
.
e
rror
:
except
OSE
rror
:
self
.
handle_error
()
return
...
...
Lib/asyncore.py
View file @
0c6fec79
...
...
@@ -112,7 +112,7 @@ def readwrite(obj, flags):
obj
.
handle_expt_event
()
if
flags
&
(
select
.
POLLHUP
|
select
.
POLLERR
|
select
.
POLLNVAL
):
obj
.
handle_close
()
except
socket
.
e
rror
as
e
:
except
OSE
rror
as
e
:
if
e
.
args
[
0
]
not
in
_DISCONNECTED
:
obj
.
handle_error
()
else
:
...
...
@@ -240,7 +240,7 @@ class dispatcher:
# passed be connected.
try
:
self
.
addr
=
sock
.
getpeername
()
except
socket
.
e
rror
as
err
:
except
OSE
rror
as
err
:
if
err
.
args
[
0
]
in
(
ENOTCONN
,
EINVAL
):
# To handle the case where we got an unconnected
# socket.
...
...
@@ -304,7 +304,7 @@ class dispatcher:
self
.
socket
.
getsockopt
(
socket
.
SOL_SOCKET
,
socket
.
SO_REUSEADDR
)
|
1
)
except
socket
.
e
rror
:
except
OSE
rror
:
pass
# ==================================================
...
...
@@ -345,7 +345,7 @@ class dispatcher:
self
.
addr
=
address
self
.
handle_connect_event
()
else
:
raise
socket
.
e
rror
(
err
,
errorcode
[
err
])
raise
OSE
rror
(
err
,
errorcode
[
err
])
def
accept
(
self
):
# XXX can return either an address pair or None
...
...
@@ -353,7 +353,7 @@ class dispatcher:
conn
,
addr
=
self
.
socket
.
accept
()
except
TypeError
:
return
None
except
socket
.
e
rror
as
why
:
except
OSE
rror
as
why
:
if
why
.
args
[
0
]
in
(
EWOULDBLOCK
,
ECONNABORTED
,
EAGAIN
):
return
None
else
:
...
...
@@ -365,7 +365,7 @@ class dispatcher:
try
:
result
=
self
.
socket
.
send
(
data
)
return
result
except
socket
.
e
rror
as
why
:
except
OSE
rror
as
why
:
if
why
.
args
[
0
]
==
EWOULDBLOCK
:
return
0
elif
why
.
args
[
0
]
in
_DISCONNECTED
:
...
...
@@ -384,7 +384,7 @@ class dispatcher:
return
b''
else
:
return
data
except
socket
.
e
rror
as
why
:
except
OSE
rror
as
why
:
# winsock sometimes raises ENOTCONN
if
why
.
args
[
0
]
in
_DISCONNECTED
:
self
.
handle_close
()
...
...
@@ -399,7 +399,7 @@ class dispatcher:
self
.
del_channel
()
try
:
self
.
socket
.
close
()
except
socket
.
e
rror
as
why
:
except
OSE
rror
as
why
:
if
why
.
args
[
0
]
not
in
(
ENOTCONN
,
EBADF
):
raise
...
...
@@ -443,7 +443,7 @@ class dispatcher:
def
handle_connect_event
(
self
):
err
=
self
.
socket
.
getsockopt
(
socket
.
SOL_SOCKET
,
socket
.
SO_ERROR
)
if
err
!=
0
:
raise
socket
.
e
rror
(
err
,
_strerror
(
err
))
raise
OSE
rror
(
err
,
_strerror
(
err
))
self
.
handle_connect
()
self
.
connected
=
True
self
.
connecting
=
False
...
...
Lib/distutils/command/upload.py
View file @
0c6fec79
...
...
@@ -186,7 +186,7 @@ class upload(PyPIRCCommand):
http
.
putheader
(
'Authorization'
,
auth
)
http
.
endheaders
()
http
.
send
(
body
)
except
socket
.
e
rror
as
e
:
except
OSE
rror
as
e
:
self
.
announce
(
str
(
e
),
log
.
ERROR
)
return
...
...
Lib/ftplib.py
View file @
0c6fec79
...
...
@@ -123,7 +123,7 @@ class FTP:
if
self
.
sock
is
not
None
:
try
:
self
.
quit
()
except
(
socket
.
e
rror
,
EOFError
):
except
(
OSE
rror
,
EOFError
):
pass
finally
:
if
self
.
sock
is
not
None
:
...
...
@@ -295,7 +295,7 @@ class FTP:
try
:
sock
=
socket
.
socket
(
af
,
socktype
,
proto
)
sock
.
bind
(
sa
)
except
socket
.
e
rror
as
_
:
except
OSE
rror
as
_
:
err
=
_
if
sock
:
sock
.
close
()
...
...
@@ -306,8 +306,8 @@ class FTP:
if
err
is
not
None
:
raise
err
else
:
raise
socket
.
e
rror
(
"getaddrinfo returns an empty list"
)
raise
socket
.
e
rror
(
msg
)
raise
OSE
rror
(
"getaddrinfo returns an empty list"
)
raise
OSE
rror
(
msg
)
sock
.
listen
(
1
)
port
=
sock
.
getsockname
()[
1
]
# Get proper port
host
=
self
.
sock
.
getsockname
()[
0
]
# Get proper host
...
...
Lib/http/client.py
View file @
0c6fec79
...
...
@@ -791,8 +791,8 @@ class HTTPConnection:
if
code
!=
200
:
self
.
close
()
raise
socket
.
e
rror
(
"Tunnel connection failed: %d %s"
%
(
code
,
message
.
strip
()))
raise
OSE
rror
(
"Tunnel connection failed: %d %s"
%
(
code
,
message
.
strip
()))
while
True
:
line
=
response
.
fp
.
readline
(
_MAXLINE
+
1
)
if
len
(
line
)
>
_MAXLINE
:
...
...
Lib/idlelib/PyShell.py
View file @
0c6fec79
...
...
@@ -393,7 +393,7 @@ class ModifiedInterpreter(InteractiveInterpreter):
try
:
self
.
rpcclt
=
MyRPCClient
(
addr
)
break
except
socket
.
e
rror
as
err
:
except
OSE
rror
as
err
:
pass
else
:
self
.
display_port_binding_error
()
...
...
Lib/idlelib/rpc.py
View file @
0c6fec79
...
...
@@ -199,7 +199,7 @@ class SocketIO(object):
raise
except
KeyboardInterrupt
:
raise
except
socket
.
e
rror
:
except
OSE
rror
:
raise
except
Exception
as
ex
:
return
(
"CALLEXC"
,
ex
)
...
...
@@ -340,7 +340,7 @@ class SocketIO(object):
n
=
self
.
sock
.
send
(
s
[:
BUFSIZE
])
except
(
AttributeError
,
TypeError
):
raise
IOError
(
"socket no longer exists"
)
except
socket
.
e
rror
:
except
OSE
rror
:
raise
else
:
s
=
s
[
n
:]
...
...
@@ -357,7 +357,7 @@ class SocketIO(object):
return
None
try
:
s
=
self
.
sock
.
recv
(
BUFSIZE
)
except
socket
.
e
rror
:
except
OSE
rror
:
raise
EOFError
if
len
(
s
)
==
0
:
raise
EOFError
...
...
@@ -537,7 +537,7 @@ class RPCClient(SocketIO):
SocketIO
.
__init__
(
self
,
working_sock
)
else
:
print
(
"** Invalid host: "
,
address
,
file
=
sys
.
__stderr__
)
raise
socket
.
e
rror
raise
OSE
rror
def
get_remote_proxy
(
self
,
oid
):
return
RPCProxy
(
self
,
oid
)
...
...
Lib/idlelib/run.py
View file @
0c6fec79
...
...
@@ -135,8 +135,8 @@ def manage_socket(address):
try
:
server
=
MyRPCServer
(
address
,
MyHandler
)
break
except
socket
.
e
rror
as
err
:
print
(
"IDLE Subprocess:
socket e
rror: "
+
err
.
args
[
1
]
+
except
OSE
rror
as
err
:
print
(
"IDLE Subprocess:
OSE
rror: "
+
err
.
args
[
1
]
+
", retrying...."
,
file
=
sys
.
__stderr__
)
socket_error
=
err
else
:
...
...
Lib/imaplib.py
View file @
0c6fec79
...
...
@@ -174,7 +174,7 @@ class IMAP4:
except Exception:
try:
self.shutdown()
except
socket.e
rror:
except
OSE
rror:
pass
raise
...
...
@@ -267,7 +267,7 @@ class IMAP4:
self
.
file
.
close
()
try
:
self
.
sock
.
shutdown
(
socket
.
SHUT_RDWR
)
except
socket
.
e
rror
as
e
:
except
OSE
rror
as
e
:
# The server might already have closed the connection
if
e
.
errno
!=
errno
.
ENOTCONN
:
raise
...
...
@@ -899,7 +899,7 @@ class IMAP4:
try
:
self
.
send
(
data
+
CRLF
)
except
(
socket
.
error
,
OSError
)
as
val
:
except
OSError
as
val
:
raise
self
.
abort
(
'socket error: %s'
%
val
)
if
literal
is
None
:
...
...
@@ -924,7 +924,7 @@ class IMAP4:
try
:
self
.
send
(
literal
)
self
.
send
(
CRLF
)
except
(
socket
.
error
,
OSError
)
as
val
:
except
OSError
as
val
:
raise
self
.
abort
(
'socket error: %s'
%
val
)
if
not
literator
:
...
...
Lib/logging/config.py
View file @
0c6fec79
...
...
@@ -844,7 +844,7 @@ def listen(port=DEFAULT_LOGGING_CONFIG_PORT, verify=None):
traceback.print_exc()
if self.server.ready:
self.server.ready.set()
except
socket.e
rror as e:
except
OSE
rror as e:
if not isinstance(e.args, tuple):
raise
else:
...
...
Lib/logging/handlers.py
View file @
0c6fec79
...
...
@@ -514,7 +514,7 @@ class SocketHandler(logging.Handler):
try
:
self
.
sock
=
self
.
makeSocket
()
self
.
retryTime
=
None
# next time, no delay before trying
except
socket
.
e
rror
:
except
OSE
rror
:
#Creation failed, so set the retry time and return.
if
self
.
retryTime
is
None
:
self
.
retryPeriod
=
self
.
retryStart
...
...
@@ -539,7 +539,7 @@ class SocketHandler(logging.Handler):
if
self
.
sock
:
try
:
self
.
sock
.
sendall
(
s
)
except
socket
.
e
rror
:
#pragma: no cover
except
OSE
rror
:
#pragma: no cover
self
.
sock
.
close
()
self
.
sock
=
None
# so we can call createSocket next time
...
...
@@ -775,7 +775,7 @@ class SysLogHandler(logging.Handler):
self
.
socket
=
socket
.
socket
(
socket
.
AF_UNIX
,
self
.
socktype
)
try
:
self
.
socket
.
connect
(
address
)
except
socket
.
e
rror
:
except
OSE
rror
:
self
.
socket
.
close
()
raise
...
...
@@ -842,7 +842,7 @@ class SysLogHandler(logging.Handler):
if
self
.
unixsocket
:
try
:
self
.
socket
.
send
(
msg
)
except
socket
.
e
rror
:
except
OSE
rror
:
self
.
_connect_unixsocket
(
self
.
address
)
self
.
socket
.
send
(
msg
)
elif
self
.
socktype
==
socket
.
SOCK_DGRAM
:
...
...
Lib/nntplib.py
View file @
0c6fec79
...
...
@@ -359,7 +359,7 @@ class _NNTPBase:
if
is_connected
():
try
:
self
.
quit
()
except
(
socket
.
e
rror
,
EOFError
):
except
(
OSE
rror
,
EOFError
):
pass
finally
:
if
is_connected
():
...
...
Lib/platform.py
View file @
0c6fec79
...
...
@@ -882,7 +882,7 @@ def _node(default=''):
return default
try:
return socket.gethostname()
except
socket.e
rror:
except
OSE
rror:
# Still not working...
return default
...
...
Lib/poplib.py
View file @
0c6fec79
...
...
@@ -272,7 +272,7 @@ class POP3:
if
self
.
sock
is
not
None
:
try
:
self
.
sock
.
shutdown
(
socket
.
SHUT_RDWR
)
except
socket
.
e
rror
as
e
:
except
OSE
rror
as
e
:
# The server might already have closed the connection
if
e
.
errno
!=
errno
.
ENOTCONN
:
raise
...
...
Lib/smtpd.py
View file @
0c6fec79
...
...
@@ -137,7 +137,7 @@ class SMTPChannel(asynchat.async_chat):
self
.
num_bytes
=
0
try
:
self
.
peer
=
conn
.
getpeername
()
except
socket
.
e
rror
as
err
:
except
OSE
rror
as
err
:
# a race condition may occur if the other end is closing
# before we can get the peername
self
.
close
()
...
...
@@ -668,7 +668,7 @@ class PureProxy(SMTPServer):
except
smtplib
.
SMTPRecipientsRefused
as
e
:
print
(
'got SMTPRecipientsRefused'
,
file
=
DEBUGSTREAM
)
refused
=
e
.
recipients
except
(
socket
.
e
rror
,
smtplib
.
SMTPException
)
as
e
:
except
(
OSE
rror
,
smtplib
.
SMTPException
)
as
e
:
print
(
'got'
,
e
.
__class__
,
file
=
DEBUGSTREAM
)
# All recipients were refused. If the exception had an associated
# error code, use it. Otherwise,fake it with a non-triggering
...
...
Lib/socketserver.py
View file @
0c6fec79
...
...
@@ -299,7 +299,7 @@ class BaseServer:
"""
try
:
request
,
client_address
=
self
.
get_request
()
except
socket
.
e
rror
:
except
OSE
rror
:
return
if
self
.
verify_request
(
request
,
client_address
):
try
:
...
...
@@ -479,7 +479,7 @@ class TCPServer(BaseServer):
#explicitly shutdown. socket.close() merely releases
#the socket and waits for GC to perform the actual close.
request
.
shutdown
(
socket
.
SHUT_WR
)
except
socket
.
e
rror
:
except
OSE
rror
:
pass
#some platforms may raise ENOTCONN here
self
.
close_request
(
request
)
...
...
Lib/ssl.py
View file @
0c6fec79
...
...
@@ -109,12 +109,14 @@ else:
_PROTOCOL_NAMES
[
PROTOCOL_SSLv2
]
=
"SSLv2"
from
socket
import
getnameinfo
as
_getnameinfo
from
socket
import
error
as
socket_error
from
socket
import
socket
,
AF_INET
,
SOCK_STREAM
,
create_connection
import
base64
# for DER-to-PEM translation
import
traceback
import
errno
socket_error
=
OSError
# keep that public name in module namespace
if
_ssl
.
HAS_TLS_UNIQUE
:
CHANNEL_BINDING_TYPES
=
[
'tls-unique'
]
else
:
...
...
@@ -279,7 +281,7 @@ class SSLSocket(socket):
# see if it'
s
connected
try
:
sock
.
getpeername
()
except
socket_e
rror
as
e
:
except
OSE
rror
as
e
:
if
e
.
errno
!=
errno
.
ENOTCONN
:
raise
else
:
...
...
@@ -305,7 +307,7 @@ class SSLSocket(socket):
raise
ValueError
(
"do_handshake_on_connect should not be specified for non-blocking sockets"
)
self
.
do_handshake
()
except
socket_e
rror
as
x
:
except
OSE
rror
as
x
:
self
.
close
()
raise
x
...
...
@@ -533,7 +535,7 @@ class SSLSocket(socket):
self
.
do_handshake
()
self
.
_connected
=
True
return
rc
except
socket_e
rror
:
except
OSE
rror
:
self
.
_sslobj
=
None
raise
...
...
Lib/telnetlib.py
View file @
0c6fec79
...
...
@@ -273,7 +273,7 @@ class Telnet:
"""Write a string to the socket, doubling any IAC characters.
Can block if the connection is blocked. May raise
socket.e
rror if the connection is closed.
OSE
rror if the connection is closed.
"""
if
IAC
in
buffer
:
...
...
Lib/test/ssl_servers.py
View file @
0c6fec79
...
...
@@ -35,7 +35,7 @@ class HTTPSServer(_HTTPServer):
try
:
sock
,
addr
=
self
.
socket
.
accept
()
sslconn
=
self
.
context
.
wrap_socket
(
sock
,
server_side
=
True
)
except
socket
.
e
rror
as
e
:
except
OSE
rror
as
e
:
# socket errors are silenced by the caller, print them here
if
support
.
verbose
:
sys
.
stderr
.
write
(
"Got an error:
\
n
%s
\
n
"
%
e
)
...
...
Lib/test/support.py
View file @
0c6fec79
...
...
@@ -496,7 +496,7 @@ def find_unused_port(family=socket.AF_INET, socktype=socket.SOCK_STREAM):
the SO_REUSEADDR socket option having different semantics on Windows versus
Unix/Linux. On Unix, you can't have two AF_INET SOCK_STREAM sockets bind,
listen and then accept connections on identical host/ports. An EADDRINUSE
socket.e
rror will be raised at some point (depending on the platform and
OSE
rror will be raised at some point (depending on the platform and
the order bind and listen were called on each socket).
However, on Windows, if SO_REUSEADDR is set on the sockets, no EADDRINUSE
...
...
@@ -570,7 +570,7 @@ def _is_ipv6_enabled():
sock
=
socket
.
socket
(
socket
.
AF_INET6
,
socket
.
SOCK_STREAM
)
sock
.
bind
((
'::1'
,
0
))
return
True
except
(
socket
.
error
,
socket
.
gaierror
)
:
except
OSError
:
pass
finally
:
if
sock
:
...
...
@@ -1098,7 +1098,7 @@ class TransientResource(object):
# with the Internet connection manifest themselves as exceptions.
# XXX deprecate these and use transient_internet() instead
time_out
=
TransientResource
(
IOError
,
errno
=
errno
.
ETIMEDOUT
)
socket_peer_reset
=
TransientResource
(
socket
.
e
rror
,
errno
=
errno
.
ECONNRESET
)
socket_peer_reset
=
TransientResource
(
OSE
rror
,
errno
=
errno
.
ECONNRESET
)
ioerror_peer_reset
=
TransientResource
(
IOError
,
errno
=
errno
.
ECONNRESET
)
...
...
Lib/test/test_asyncore.py
View file @
0c6fec79
...
...
@@ -756,7 +756,7 @@ class BaseTestAPI(unittest.TestCase):
s2
=
asyncore
.
dispatcher
()
s2
.
create_socket
(
self
.
family
)
# EADDRINUSE indicates the socket was correctly bound
self
.
assertRaises
(
socket
.
e
rror
,
s2
.
bind
,
(
self
.
addr
[
0
],
port
))
self
.
assertRaises
(
OSE
rror
,
s2
.
bind
,
(
self
.
addr
[
0
],
port
))
def
test_set_reuse_addr
(
self
):
if
HAS_UNIX_SOCKETS
and
self
.
family
==
socket
.
AF_UNIX
:
...
...
@@ -764,7 +764,7 @@ class BaseTestAPI(unittest.TestCase):
sock
=
socket
.
socket
(
self
.
family
)
try
:
sock
.
setsockopt
(
socket
.
SOL_SOCKET
,
socket
.
SO_REUSEADDR
,
1
)
except
socket
.
e
rror
:
except
OSE
rror
:
unittest
.
skip
(
"SO_REUSEADDR not supported on this platform"
)
else
:
# if SO_REUSEADDR succeeded for sock we expect asyncore
...
...
@@ -797,7 +797,7 @@ class BaseTestAPI(unittest.TestCase):
struct
.
pack
(
'ii'
,
1
,
0
))
try
:
s
.
connect
(
server
.
address
)
except
socket
.
e
rror
:
except
OSE
rror
:
pass
finally
:
s
.
close
()
...
...
Lib/test/test_epoll.py
View file @
0c6fec79
...
...
@@ -56,7 +56,7 @@ class TestEPoll(unittest.TestCase):
client
.
setblocking
(
False
)
try
:
client
.
connect
((
'127.0.0.1'
,
self
.
serverSocket
.
getsockname
()[
1
]))
except
socket
.
e
rror
as
e
:
except
OSE
rror
as
e
:
self
.
assertEqual
(
e
.
args
[
0
],
errno
.
EINPROGRESS
)
else
:
raise
AssertionError
(
"Connect should have raised EINPROGRESS"
)
...
...
Lib/test/test_ftplib.py
View file @
0c6fec79
...
...
@@ -321,7 +321,7 @@ if ssl is not None:
elif
err
.
args
[
0
]
==
ssl
.
SSL_ERROR_EOF
:
return
self
.
handle_close
()
raise
except
socket
.
e
rror
as
err
:
except
OSE
rror
as
err
:
if
err
.
args
[
0
]
==
errno
.
ECONNABORTED
:
return
self
.
handle_close
()
else
:
...
...
@@ -335,7 +335,7 @@ if ssl is not None:
if
err
.
args
[
0
]
in
(
ssl
.
SSL_ERROR_WANT_READ
,
ssl
.
SSL_ERROR_WANT_WRITE
):
return
except
socket
.
e
rror
as
err
:
except
OSE
rror
as
err
:
# Any "socket error" corresponds to a SSL_ERROR_SYSCALL return
# from OpenSSL's SSL_shutdown(), corresponding to a
# closed socket condition. See also:
...
...
@@ -676,7 +676,7 @@ class TestFTPClass(TestCase):
return
False
try
:
self
.
client
.
sendcmd
(
'noop'
)
except
(
socket
.
e
rror
,
EOFError
):
except
(
OSE
rror
,
EOFError
):
return
False
return
True
...
...
Lib/test/test_httplib.py
View file @
0c6fec79
...
...
@@ -45,7 +45,7 @@ class EPipeSocket(FakeSocket):
def
sendall
(
self
,
data
):
if
self
.
pipe_trigger
in
data
:
raise
socket
.
e
rror
(
errno
.
EPIPE
,
"gotcha"
)
raise
OSE
rror
(
errno
.
EPIPE
,
"gotcha"
)
self
.
data
+=
data
def
close
(
self
):
...
...
@@ -515,7 +515,7 @@ class BasicTest(TestCase):
b"Content-Length"
)
conn
=
client
.
HTTPConnection
(
"example.com"
)
conn
.
sock
=
sock
self
.
assertRaises
(
socket
.
e
rror
,
self
.
assertRaises
(
OSE
rror
,
lambda
:
conn
.
request
(
"PUT"
,
"/url"
,
"body"
))
resp
=
conn
.
getresponse
()
self
.
assertEqual
(
401
,
resp
.
status
)
...
...
Lib/test/test_kqueue.py
View file @
0c6fec79
...
...
@@ -94,7 +94,7 @@ class TestKQueue(unittest.TestCase):
client
.
setblocking
(
False
)
try
:
client
.
connect
((
'127.0.0.1'
,
serverSocket
.
getsockname
()[
1
]))
except
socket
.
e
rror
as
e
:
except
OSE
rror
as
e
:
self
.
assertEqual
(
e
.
args
[
0
],
errno
.
EINPROGRESS
)
else
:
#raise AssertionError("Connect should have raised EINPROGRESS")
...
...
Lib/test/test_logging.py
View file @
0c6fec79
...
...
@@ -569,7 +569,7 @@ class HandlerTest(BaseTest):
self.assertEqual(h.facility, h.LOG_USER)
self.assertTrue(h.unixsocket)
h.close()
except
socket.e
rror: # syslogd might not be available
except
OSE
rror: # syslogd might not be available
pass
for method in ('GET', 'POST', 'PUT'):
if method == 'PUT':
...
...
@@ -679,7 +679,7 @@ if threading:
self.num_bytes = 0
try:
self.peer = conn.getpeername()
except
socket.e
rror as err:
except
OSE
rror as err:
# a race condition may occur if the other end is closing
# before we can get the peername
self.close()
...
...
@@ -880,7 +880,7 @@ if threading:
sock, addr = self.socket.accept()
if self.sslctx:
sock = self.sslctx.wrap_socket(sock, server_side=True)
except
socket.e
rror as e:
except
OSE
rror as e:
# socket errors are silenced by the caller, print them here
sys.stderr.write("
Got
an
error
:
\
n
%
s
\
n
" % e)
raise
...
...
@@ -946,7 +946,7 @@ if threading:
if data:
try:
super(DelegatingUDPRequestHandler, self).finish()
except
socket.e
rror:
except
OSE
rror:
if not self.server._closed:
raise
...
...
Lib/test/test_nntplib.py
View file @
0c6fec79
...
...
@@ -264,7 +264,7 @@ class NetworkedNNTPTestsMixin:
return
False
try
:
server
.
help
()
except
(
socket
.
e
rror
,
EOFError
):
except
(
OSE
rror
,
EOFError
):
return
False
return
True
...
...
Lib/test/test_poplib.py
View file @
0c6fec79
...
...
@@ -167,7 +167,7 @@ class DummyPOP3Handler(asynchat.async_chat):
elif
err
.
args
[
0
]
==
ssl
.
SSL_ERROR_EOF
:
return
self
.
handle_close
()
raise
except
socket
.
e
rror
as
err
:
except
OSE
rror
as
err
:
if
err
.
args
[
0
]
==
errno
.
ECONNABORTED
:
return
self
.
handle_close
()
else
:
...
...
Lib/test/test_smtplib.py
View file @
0c6fec79
...
...
@@ -535,7 +535,7 @@ class NonConnectingTests(unittest.TestCase):
smtp
.
send
,
'test msg'
)
def
testNonnumericPort
(
self
):
# check that non-numeric port raises
socket.e
rror
# check that non-numeric port raises
OSE
rror
self
.
assertRaises
(
OSError
,
smtplib
.
SMTP
,
"localhost"
,
"bogus"
)
self
.
assertRaises
(
OSError
,
smtplib
.
SMTP
,
...
...
Lib/test/test_socket.py
View file @
0c6fec79
This diff is collapsed.
Click to expand it.
Lib/test/test_ssl.py
View file @
0c6fec79
...
...
@@ -213,15 +213,15 @@ class BasicSocketTests(unittest.TestCase):
def
test_wrapped_unconnected
(
self
):
# Methods on an unconnected SSLSocket propagate the original
#
socket.e
rror raise by the underlying socket object.
#
OSE
rror raise by the underlying socket object.
s
=
socket
.
socket
(
socket
.
AF_INET
)
ss
=
ssl
.
wrap_socket
(
s
)
self
.
assertRaises
(
socket
.
e
rror
,
ss
.
recv
,
1
)
self
.
assertRaises
(
socket
.
e
rror
,
ss
.
recv_into
,
bytearray
(
b'x'
))
self
.
assertRaises
(
socket
.
e
rror
,
ss
.
recvfrom
,
1
)
self
.
assertRaises
(
socket
.
e
rror
,
ss
.
recvfrom_into
,
bytearray
(
b'x'
),
1
)
self
.
assertRaises
(
socket
.
e
rror
,
ss
.
send
,
b'x'
)
self
.
assertRaises
(
socket
.
e
rror
,
ss
.
sendto
,
b'x'
,
(
'0.0.0.0'
,
0
))
self
.
assertRaises
(
OSE
rror
,
ss
.
recv
,
1
)
self
.
assertRaises
(
OSE
rror
,
ss
.
recv_into
,
bytearray
(
b'x'
))
self
.
assertRaises
(
OSE
rror
,
ss
.
recvfrom
,
1
)
self
.
assertRaises
(
OSE
rror
,
ss
.
recvfrom_into
,
bytearray
(
b'x'
),
1
)
self
.
assertRaises
(
OSE
rror
,
ss
.
send
,
b'x'
)
self
.
assertRaises
(
OSE
rror
,
ss
.
sendto
,
b'x'
,
(
'0.0.0.0'
,
0
))
def
test_timeout
(
self
):
# Issue #8524: when creating an SSL socket, the timeout of the
...
...
@@ -1012,7 +1012,7 @@ else:
sys
.
stdout
.
write
(
" server: read %r (%s), sending back %r (%s)...
\
n
"
%
(
msg
,
ctype
,
msg
.
lower
(),
ctype
))
self
.
write
(
msg
.
lower
())
except
socket
.
e
rror
:
except
OSE
rror
:
if
self
.
server
.
chatty
:
handle_error
(
"Test server failure:
\
n
"
)
self
.
close
()
...
...
@@ -1122,7 +1122,7 @@ else:
return
self
.
handle_close
()
except
ssl
.
SSLError
:
raise
except
socket
.
e
rror
as
err
:
except
OSE
rror
as
err
:
if
err
.
args
[
0
]
==
errno
.
ECONNABORTED
:
return
self
.
handle_close
()
else
:
...
...
@@ -1226,9 +1226,9 @@ else:
except
ssl
.
SSLError
as
x
:
if
support
.
verbose
:
sys
.
stdout
.
write
(
"
\
n
SSLError is %s
\
n
"
%
x
.
args
[
1
])
except
socket
.
e
rror
as
x
:
except
OSE
rror
as
x
:
if
support
.
verbose
:
sys
.
stdout
.
write
(
"
\
n
socket.e
rror is %s
\
n
"
%
x
.
args
[
1
])
sys
.
stdout
.
write
(
"
\
n
OSE
rror is %s
\
n
"
%
x
.
args
[
1
])
except
IOError
as
x
:
if
x
.
errno
!=
errno
.
ENOENT
:
raise
...
...
@@ -1313,7 +1313,7 @@ else:
except
ssl
.
SSLError
:
if
expect_success
:
raise
except
socket
.
e
rror
as
e
:
except
OSE
rror
as
e
:
if
expect_success
or
e
.
errno
!=
errno
.
ECONNRESET
:
raise
else
:
...
...
@@ -1458,7 +1458,7 @@ else:
if
hasattr
(
ssl
,
'PROTOCOL_SSLv2'
):
try
:
try_protocol_combo
(
ssl
.
PROTOCOL_SSLv23
,
ssl
.
PROTOCOL_SSLv2
,
True
)
except
(
ssl
.
SSLError
,
socket
.
error
)
as
x
:
except
OSError
as
x
:
# this fails on some older versions of OpenSSL (0.9.7l, for instance)
if
support
.
verbose
:
sys
.
stdout
.
write
(
...
...
@@ -1844,7 +1844,7 @@ else:
chatty
=
False
)
as
server
:
with
socket
.
socket
()
as
sock
:
s
=
context
.
wrap_socket
(
sock
)
with
self
.
assertRaises
(
(
OSError
,
ssl
.
SSLError
)
):
with
self
.
assertRaises
(
OSError
):
s
.
connect
((
HOST
,
server
.
port
))
self
.
assertIn
(
"no shared cipher"
,
str
(
server
.
conn_errors
[
0
]))
...
...
Lib/test/test_urllib2.py
View file @
0c6fec79
...
...
@@ -344,7 +344,7 @@ class MockHTTPClass:
self
.
data
=
body
if
self
.
raise_on_endheaders
:
import
socket
raise
socket
.
e
rror
()
raise
OSE
rror
()
def
getresponse
(
self
):
return
MockHTTPResponse
(
MockFile
(),
{},
200
,
"OK"
)
...
...
@@ -845,7 +845,7 @@ class HandlerTests(unittest.TestCase):
(
"Foo"
,
"bar"
),
(
"Spam"
,
"eggs"
)])
self
.
assertEqual
(
http
.
data
,
data
)
# check
socket.e
rror converted to URLError
# check
OSE
rror converted to URLError
http
.
raise_on_endheaders
=
True
self
.
assertRaises
(
urllib
.
error
.
URLError
,
h
.
do_open
,
http
,
req
)
...
...
Lib/test/test_xmlrpc.py
View file @
0c6fec79
...
...
@@ -215,7 +215,7 @@ class XMLRPCTestCase(unittest.TestCase):
xmlrpc
.
client
.
ServerProxy
(
'https://localhost:9999'
).
bad_function
()
except
NotImplementedError
:
self
.
assertFalse
(
has_ssl
,
"xmlrpc client's error with SSL support"
)
except
socket
.
e
rror
:
except
OSE
rror
:
self
.
assertTrue
(
has_ssl
)
class
HelperTestCase
(
unittest
.
TestCase
):
...
...
@@ -492,7 +492,7 @@ def is_unavailable_exception(e):
return
True
exc_mess
=
e
.
headers
.
get
(
'X-exception'
)
except
AttributeError
:
# Ignore
socket.e
rrors here.
# Ignore
OSE
rrors here.
exc_mess
=
str
(
e
)
if
exc_mess
and
'temporarily unavailable'
in
exc_mess
.
lower
():
...
...
@@ -507,7 +507,7 @@ def make_request_and_skipIf(condition, reason):
def
make_request_and_skip
(
self
):
try
:
xmlrpclib
.
ServerProxy
(
URL
).
my_function
()
except
(
xmlrpclib
.
ProtocolError
,
socket
.
e
rror
)
as
e
:
except
(
xmlrpclib
.
ProtocolError
,
OSE
rror
)
as
e
:
if
not
is_unavailable_exception
(
e
):
raise
raise
unittest
.
SkipTest
(
reason
)
...
...
@@ -545,7 +545,7 @@ class SimpleServerTestCase(BaseServerTestCase):
try
:
p
=
xmlrpclib
.
ServerProxy
(
URL
)
self
.
assertEqual
(
p
.
pow
(
6
,
8
),
6
**
8
)
except
(
xmlrpclib
.
ProtocolError
,
socket
.
e
rror
)
as
e
:
except
(
xmlrpclib
.
ProtocolError
,
OSE
rror
)
as
e
:
# ignore failures due to non-blocking socket 'unavailable' errors
if
not
is_unavailable_exception
(
e
):
# protocol error; provide additional information in test output
...
...
@@ -558,7 +558,7 @@ class SimpleServerTestCase(BaseServerTestCase):
p
=
xmlrpclib
.
ServerProxy
(
URL
)
self
.
assertEqual
(
p
.
add
(
start_string
,
end_string
),
start_string
+
end_string
)
except
(
xmlrpclib
.
ProtocolError
,
socket
.
e
rror
)
as
e
:
except
(
xmlrpclib
.
ProtocolError
,
OSE
rror
)
as
e
:
# ignore failures due to non-blocking socket 'unavailable' errors
if
not
is_unavailable_exception
(
e
):
# protocol error; provide additional information in test output
...
...
@@ -584,7 +584,7 @@ class SimpleServerTestCase(BaseServerTestCase):
p
=
xmlrpclib
.
ServerProxy
(
URL
)
meth
=
p
.
system
.
listMethods
()
self
.
assertEqual
(
set
(
meth
),
expected_methods
)
except
(
xmlrpclib
.
ProtocolError
,
socket
.
e
rror
)
as
e
:
except
(
xmlrpclib
.
ProtocolError
,
OSE
rror
)
as
e
:
# ignore failures due to non-blocking socket 'unavailable' errors
if
not
is_unavailable_exception
(
e
):
# protocol error; provide additional information in test output
...
...
@@ -597,7 +597,7 @@ class SimpleServerTestCase(BaseServerTestCase):
p
=
xmlrpclib
.
ServerProxy
(
URL
)
divhelp
=
p
.
system
.
methodHelp
(
'div'
)
self
.
assertEqual
(
divhelp
,
'This is the div function'
)
except
(
xmlrpclib
.
ProtocolError
,
socket
.
e
rror
)
as
e
:
except
(
xmlrpclib
.
ProtocolError
,
OSE
rror
)
as
e
:
# ignore failures due to non-blocking socket 'unavailable' errors
if
not
is_unavailable_exception
(
e
):
# protocol error; provide additional information in test output
...
...
@@ -611,7 +611,7 @@ class SimpleServerTestCase(BaseServerTestCase):
p
=
xmlrpclib
.
ServerProxy
(
URL
)
myfunction
=
p
.
system
.
methodHelp
(
'my_function'
)
self
.
assertEqual
(
myfunction
,
'This is my function'
)
except
(
xmlrpclib
.
ProtocolError
,
socket
.
e
rror
)
as
e
:
except
(
xmlrpclib
.
ProtocolError
,
OSE
rror
)
as
e
:
# ignore failures due to non-blocking socket 'unavailable' errors
if
not
is_unavailable_exception
(
e
):
# protocol error; provide additional information in test output
...
...
@@ -624,7 +624,7 @@ class SimpleServerTestCase(BaseServerTestCase):
p
=
xmlrpclib
.
ServerProxy
(
URL
)
divsig
=
p
.
system
.
methodSignature
(
'div'
)
self
.
assertEqual
(
divsig
,
'signatures not supported'
)
except
(
xmlrpclib
.
ProtocolError
,
socket
.
e
rror
)
as
e
:
except
(
xmlrpclib
.
ProtocolError
,
OSE
rror
)
as
e
:
# ignore failures due to non-blocking socket 'unavailable' errors
if
not
is_unavailable_exception
(
e
):
# protocol error; provide additional information in test output
...
...
@@ -641,7 +641,7 @@ class SimpleServerTestCase(BaseServerTestCase):
self
.
assertEqual
(
add_result
,
2
+
3
)
self
.
assertEqual
(
pow_result
,
6
**
8
)
self
.
assertEqual
(
div_result
,
127
//
42
)
except
(
xmlrpclib
.
ProtocolError
,
socket
.
e
rror
)
as
e
:
except
(
xmlrpclib
.
ProtocolError
,
OSE
rror
)
as
e
:
# ignore failures due to non-blocking socket 'unavailable' errors
if
not
is_unavailable_exception
(
e
):
# protocol error; provide additional information in test output
...
...
@@ -662,7 +662,7 @@ class SimpleServerTestCase(BaseServerTestCase):
self
.
assertEqual
(
result
.
results
[
0
][
'faultString'
],
'<class
\
'
Exception
\
'
>:method "this_is_not_exists" '
'is not supported'
)
except
(
xmlrpclib
.
ProtocolError
,
socket
.
e
rror
)
as
e
:
except
(
xmlrpclib
.
ProtocolError
,
OSE
rror
)
as
e
:
# ignore failures due to non-blocking socket 'unavailable' errors
if
not
is_unavailable_exception
(
e
):
# protocol error; provide additional information in test output
...
...
@@ -915,7 +915,7 @@ class FailingServerTestCase(unittest.TestCase):
try
:
p
=
xmlrpclib
.
ServerProxy
(
URL
)
self
.
assertEqual
(
p
.
pow
(
6
,
8
),
6
**
8
)
except
(
xmlrpclib
.
ProtocolError
,
socket
.
e
rror
)
as
e
:
except
(
xmlrpclib
.
ProtocolError
,
OSE
rror
)
as
e
:
# ignore failures due to non-blocking socket 'unavailable' errors
if
not
is_unavailable_exception
(
e
):
# protocol error; provide additional information in test output
...
...
@@ -928,7 +928,7 @@ class FailingServerTestCase(unittest.TestCase):
try
:
p
=
xmlrpclib
.
ServerProxy
(
URL
)
p
.
pow
(
6
,
8
)
except
(
xmlrpclib
.
ProtocolError
,
socket
.
e
rror
)
as
e
:
except
(
xmlrpclib
.
ProtocolError
,
OSE
rror
)
as
e
:
# ignore failures due to non-blocking socket 'unavailable' errors
if
not
is_unavailable_exception
(
e
)
and
hasattr
(
e
,
"headers"
):
# The two server-side error headers shouldn't be sent back in this case
...
...
@@ -948,7 +948,7 @@ class FailingServerTestCase(unittest.TestCase):
try
:
p
=
xmlrpclib
.
ServerProxy
(
URL
)
p
.
pow
(
6
,
8
)
except
(
xmlrpclib
.
ProtocolError
,
socket
.
e
rror
)
as
e
:
except
(
xmlrpclib
.
ProtocolError
,
OSE
rror
)
as
e
:
# ignore failures due to non-blocking socket 'unavailable' errors
if
not
is_unavailable_exception
(
e
)
and
hasattr
(
e
,
"headers"
):
# We should get error info in the response
...
...
Lib/test/test_xmlrpc_net.py
View file @
0c6fec79
...
...
@@ -18,7 +18,7 @@ class CurrentTimeTest(unittest.TestCase):
server
=
xmlrpclib
.
ServerProxy
(
"http://time.xmlrpc.com/RPC2"
)
try
:
t0
=
server
.
currentTime
.
getCurrentTime
()
except
socket
.
e
rror
as
e
:
except
OSE
rror
as
e
:
self
.
skipTest
(
"network error: %s"
%
e
)
return
...
...
@@ -42,7 +42,7 @@ class CurrentTimeTest(unittest.TestCase):
server
=
xmlrpclib
.
ServerProxy
(
"http://buildbot.python.org/all/xmlrpc/"
)
try
:
builders
=
server
.
getAllBuilders
()
except
socket
.
e
rror
as
e
:
except
OSE
rror
as
e
:
self
.
skipTest
(
"network error: %s"
%
e
)
return
self
.
addCleanup
(
lambda
:
server
(
'close'
)())
...
...
Lib/urllib/request.py
View file @
0c6fec79
...
...
@@ -1275,7 +1275,7 @@ class AbstractHTTPHandler(BaseHandler):
try
:
h
.
request
(
req
.
get_method
(),
req
.
selector
,
req
.
data
,
headers
)
except
socket
.
e
rror
as
err
:
# timeout error
except
OSE
rror
as
err
:
# timeout error
h
.
close
()
raise
URLError
(
err
)
else
:
...
...
@@ -1480,7 +1480,7 @@ class FTPHandler(BaseHandler):
try
:
host
=
socket
.
gethostbyname
(
host
)
except
socket
.
e
rror
as
msg
:
except
OSE
rror
as
msg
:
raise
URLError
(
msg
)
path
,
attrs
=
splitattr
(
req
.
selector
)
dirs
=
path
.
split
(
'/'
)
...
...
@@ -1721,7 +1721,7 @@ class URLopener:
return
getattr
(
self
,
name
)(
url
,
data
)
except
(
HTTPError
,
URLError
):
raise
except
socket
.
e
rror
as
msg
:
except
OSE
rror
as
msg
:
raise
IOError
(
'socket error'
,
msg
).
with_traceback
(
sys
.
exc_info
()[
2
])
def
open_unknown
(
self
,
fullurl
,
data
=
None
):
...
...
@@ -2487,7 +2487,7 @@ def _proxy_bypass_macosx_sysconf(host, proxy_settings):
try
:
hostIP
=
socket
.
gethostbyname
(
hostonly
)
hostIP
=
ip2num
(
hostIP
)
except
socket
.
e
rror
:
except
OSE
rror
:
continue
base
=
ip2num
(
m
.
group
(
1
))
...
...
@@ -2614,13 +2614,13 @@ elif os.name == 'nt':
addr
=
socket
.
gethostbyname
(
rawHost
)
if
addr
!=
rawHost
:
host
.
append
(
addr
)
except
socket
.
e
rror
:
except
OSE
rror
:
pass
try
:
fqdn
=
socket
.
getfqdn
(
rawHost
)
if
fqdn
!=
rawHost
:
host
.
append
(
fqdn
)
except
socket
.
e
rror
:
except
OSE
rror
:
pass
# make a check value list from the registry entry: replace the
# '<local>' string by the localhost entry and the corresponding
...
...
Lib/webbrowser.py
View file @
0c6fec79
...
...
@@ -418,7 +418,7 @@ class Grail(BaseBrowser):
# need to PING each one until we find one that's live
try
:
s
.
connect
(
fn
)
except
socket
.
e
rror
:
except
OSE
rror
:
# no good; attempt to clean it out, but don't fail:
try
:
os
.
unlink
(
fn
)
...
...
Lib/xmlrpc/client.py
View file @
0c6fec79
...
...
@@ -1130,8 +1130,9 @@ class Transport:
for
i
in
(
0
,
1
):
try
:
return
self
.
single_request
(
host
,
handler
,
request_body
,
verbose
)
except
socket
.
error
as
e
:
if
i
or
e
.
errno
not
in
(
errno
.
ECONNRESET
,
errno
.
ECONNABORTED
,
errno
.
EPIPE
):
except
OSError
as
e
:
if
i
or
e
.
errno
not
in
(
errno
.
ECONNRESET
,
errno
.
ECONNABORTED
,
errno
.
EPIPE
):
raise
except
http
.
client
.
BadStatusLine
:
#close after we sent request
if
i
:
...
...
Modules/socketmodule.c
View file @
0c6fec79
...
...
@@ -15,7 +15,7 @@ Limitations:
Module interface:
- socket.error: exception raised for socket specific errors
- socket.error: exception raised for socket specific errors
, alias for OSError
- socket.gaierror: exception raised for getaddrinfo/getnameinfo errors,
a subclass of socket.error
- socket.herror: exception raised for gethostby* errors,
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment