From 0f40482fde59ff307569fa5676183dd8432809a8 Mon Sep 17 00:00:00 2001 From: "Miss Islington (bot)" <31488909+miss-islington@users.noreply.github.com> Date: Fri, 10 Jan 2020 21:39:01 -0800 Subject: 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. (cherry picked from commit 43682f1e39a3c61f0e8a638b887bcdcbfef766c5) Co-authored-by: Karthikeyan Singaravelan --- Lib/socket.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Lib/socket.py b/Lib/socket.py index 5b17906..f83f36d 100644 --- a/Lib/socket.py +++ b/Lib/socket.py @@ -843,7 +843,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 -- cgit v0.12