[Python-checkins] gh-74166: make all_errors keyword-only (GH-91704)

iritkatriel webhook-mailer at python.org
Tue Apr 19 13:16:29 EDT 2022


https://github.com/python/cpython/commit/3c4380651301f255ef8149b638a1fae205ede575
commit: 3c4380651301f255ef8149b638a1fae205ede575
branch: main
author: Irit Katriel <1055913+iritkatriel at users.noreply.github.com>
committer: iritkatriel <1055913+iritkatriel at users.noreply.github.com>
date: 2022-04-19T18:16:20+01:00
summary:

gh-74166: make all_errors keyword-only (GH-91704)

files:
M Doc/library/socket.rst
M Lib/socket.py

diff --git a/Doc/library/socket.rst b/Doc/library/socket.rst
index d7a440127ec93..cff5a32afb464 100755
--- a/Doc/library/socket.rst
+++ b/Doc/library/socket.rst
@@ -660,7 +660,7 @@ The following functions all create :ref:`socket objects <socket-objects>`.
       Windows support added.
 
 
-.. function:: create_connection(address[, timeout[, source_address[, all_errors]]])
+.. function:: create_connection(address, timeout=GLOBAL_DEFAULT, source_address=None, *, all_errors=False)
 
    Connect to a TCP service listening on the internet *address* (a 2-tuple
    ``(host, port)``), and return the socket object.  This is a higher-level
diff --git a/Lib/socket.py b/Lib/socket.py
index 28d9c89d601aa..e08fb620eb1be 100755
--- a/Lib/socket.py
+++ b/Lib/socket.py
@@ -806,7 +806,7 @@ def getfqdn(name=''):
 _GLOBAL_DEFAULT_TIMEOUT = object()
 
 def create_connection(address, timeout=_GLOBAL_DEFAULT_TIMEOUT,
-                      source_address=None, all_errors=False):
+                      source_address=None, *, all_errors=False):
     """Connect to *address* and return the socket object.
 
     Convenience function.  Connect to *address* (a 2-tuple ``(host,



More information about the Python-checkins mailing list