]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
gh-154416: Fix hanging test_tcflow on DragonFly BSD (GH-154417)
authorSerhiy Storchaka <storchaka@gmail.com>
Wed, 22 Jul 2026 05:07:53 +0000 (08:07 +0300)
committerGitHub <noreply@github.com>
Wed, 22 Jul 2026 05:07:53 +0000 (05:07 +0000)
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 <noreply@anthropic.com>
Lib/test/test_termios.py

index ede23ec38860e11ca479bff9c02b1f06c6c410b6..2739b990e0906e53d4136c33484853c41bd6589e 100644 (file)
@@ -194,6 +194,9 @@ class TestFunctions(unittest.TestCase):
             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):