bpo-39259: poplib now rejects timeout = 0 (GH-17912)
poplib.POP3 and poplib.POP3_SSL now raise a ValueError
if the given timeout for their constructor is zero to
prevent the creation of a non-blocking socket.
diff --git a/Doc/library/poplib.rst b/Doc/library/poplib.rst
index 28b42fa..2f349b3 100644
--- a/Doc/library/poplib.rst
+++ b/Doc/library/poplib.rst
@@ -47,6 +47,9 @@
``poplib.putline`` with arguments ``self`` and ``line``,
where ``line`` is the bytes about to be sent to the remote host.
+ .. versionchanged:: 3.9
+ If the *timeout* parameter is set to be zero, it will raise a
+ :class:`ValueError` to prevent the creation of a non-blocking socket.
.. class:: POP3_SSL(host, port=POP3_SSL_PORT, keyfile=None, certfile=None, timeout=None, context=None)
@@ -85,6 +88,10 @@
:func:`ssl.create_default_context` select the system's trusted CA
certificates for you.
+ .. versionchanged:: 3.9
+ If the *timeout* parameter is set to be zero, it will raise a
+ :class:`ValueError` to prevent the creation of a non-blocking socket.
+
One exception is defined as an attribute of the :mod:`poplib` module:
@@ -268,4 +275,3 @@
At the end of the module, there is a test section that contains a more extensive
example of usage.
-
diff --git a/Doc/whatsnew/3.9.rst b/Doc/whatsnew/3.9.rst
index ea6d8f5..3320b7c 100644
--- a/Doc/whatsnew/3.9.rst
+++ b/Doc/whatsnew/3.9.rst
@@ -187,6 +187,13 @@
:data:`os.P_PIDFD` (:issue:`38713`) for process management with file
descriptors.
+poplib
+------
+
+:class:`~poplib.POP3` and :class:`~poplib.POP3_SSL` now raise a :class:`ValueError`
+if the given timeout for their constructor is zero to prevent the creation of
+a non-blocking socket. (Contributed by Dong-hee Na in :issue:`39259`.)
+
threading
---------