Kaydet (Commit) 81c41dbf authored tarafından Victor Stinner's avatar Victor Stinner

Issue #23618: socket.socket.connect() now waits until the connection completes

instead of raising InterruptedError if the connection is interrupted by
signals, signal handlers don't raise an exception and the socket is blocking or
has a timeout.

socket.socket.connect() still raise InterruptedError for non-blocking sockets.
üst 708d9ba5
......@@ -830,6 +830,19 @@ to sockets.
Connect to a remote socket at *address*. (The format of *address* depends on the
address family --- see above.)
If the connection is interrupted by a signal, the method waits until the
connection completes, or raise a :exc:`socket.timeout` on timeout, if the
signal handler doesn't raise an exception and the socket is blocking or has
a timeout. For non-blocking sockets, the method raises an
:exc:`InterruptedError` exception if the connection is interrupted by a
signal (or the exception raised by the signal handler).
.. versionchanged:: 3.5
The method now waits until the connection completes instead of raising an
:exc:`InterruptedError` exception if the connection is interrupted by a
signal, the signal handler doesn't raise an exception and the socket is
blocking or has a timeout (see the :pep:`475` for the rationale).
.. method:: socket.connect_ex(address)
......
......@@ -643,6 +643,7 @@ Changes in the Python API
- :func:`socket.socket` methods:
* :meth:`~socket.socket.accept`
* :meth:`~socket.socket.connect` (except for non-blocking sockets)
* :meth:`~socket.socket.recv`
* :meth:`~socket.socket.recvfrom`
* :meth:`~socket.socket.recvmsg`
......
......@@ -16,6 +16,12 @@ Core and Builtins
Library
-------
- Issue #23618: :meth:`socket.socket.connect` now waits until the connection
completes instead of raising :exc:`InterruptedError` if the connection is
interrupted by signals, signal handlers don't raise an exception and the
socket is blocking or has a timeout. :meth:`socket.socket.connect` still
raise :exc:`InterruptedError` for non-blocking sockets.
- Issue #21526: Tkinter now supports new boolean type in Tcl 8.5.
- Issue #23836: Fix the faulthandler module to handle reentrant calls to
......
This diff is collapsed.
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment