From 078323f2000e5188d12ce4631489a4d94ae668bd Mon Sep 17 00:00:00 2001 From: Serhiy Storchaka Date: Wed, 22 Jul 2026 07:37:55 +0300 Subject: [PATCH] gh-154416: Fix hanging test_tcflow on DragonFly BSD TCIOFF and TCION transmit STOP and START characters, and closing the pseudo-terminal waits until they are read. Discard them. Co-Authored-By: Claude Opus 4.8 --- Lib/test/test_termios.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/Lib/test/test_termios.py b/Lib/test/test_termios.py index 84062e464d6caf..e7a3ba3eb8d6b7 100644 --- a/Lib/test/test_termios.py +++ b/Lib/test/test_termios.py @@ -194,6 +194,9 @@ def test_tcflow(self): termios.tcflow(self.fd, termios.TCOON) termios.tcflow(self.fd, termios.TCIOFF) termios.tcflow(self.fd, termios.TCION) + # Discard the transmitted STOP and START characters, + # otherwise closing the pseudo-terminal can block. + termios.tcflush(self.fd, termios.TCOFLUSH) @support.skip_android_selinux('tcflow') def test_tcflow_errors(self):