From dce1b14e9d452ffe759ef8180c7f37aab4f59078 Mon Sep 17 00:00:00 2001 From: Serhiy Storchaka Date: Mon, 20 Jul 2026 22:25:33 +0300 Subject: [PATCH] gh-154289: Fix test_socket.testGetServBy on DragonFly (GH-154290) DragonFly lists "echo 4/ddp" before "echo 7/tcp" in /etc/services, like FreeBSD, so avoid the "echo" service there too. (cherry picked from commit 96059f9446510f594c4148d53bd1a4e3532af697) Co-authored-by: Serhiy Storchaka Co-authored-by: Claude Opus 4.8 (1M context) --- Lib/test/test_socket.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/Lib/test/test_socket.py b/Lib/test/test_socket.py index c897c0a56ae614..263fdafbad86d7 100644 --- a/Lib/test/test_socket.py +++ b/Lib/test/test_socket.py @@ -1300,7 +1300,8 @@ def testGetServBy(self): # protocol, at least for modern Linuxes. if ( sys.platform.startswith( - ('linux', 'android', 'freebsd', 'netbsd', 'gnukfreebsd')) + ('linux', 'android', 'freebsd', 'dragonfly', 'netbsd', + 'gnukfreebsd')) or is_apple ): # avoid the 'echo' service on this platform, as there is an