From: Karthikeyan Singaravelan Date: Sat, 11 Jan 2020 05:16:30 +0000 (+0530) Subject: Fix host in address of socket.create_server example. (GH-17706) X-Git-Tag: v3.9.0a3~102 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=43682f1e39a3c61f0e8a638b887bcdcbfef766c5;p=thirdparty%2FPython%2Fcpython.git Fix host in address of socket.create_server example. (GH-17706) Host as None in address raises TypeError since it should be string, bytes or bytearray. --- diff --git a/Lib/socket.py b/Lib/socket.py index 374f1124bf7e..cafa573a30c0 100755 --- a/Lib/socket.py +++ b/Lib/socket.py @@ -878,7 +878,7 @@ def create_server(address, *, family=AF_INET, backlog=None, reuse_port=False, connections. When false it will explicitly disable this option on platforms that enable it by default (e.g. Linux). - >>> with create_server((None, 8000)) as server: + >>> with create_server(('', 8000)) as server: ... while True: ... conn, addr = server.accept() ... # handle new connection