https://github.com/python/cpython/commit/9d4e8520b2f82f4250728597f008817e8a6c8f3c
commit: 9d4e8520b2f82f4250728597f008817e8a6c8f3c
branch: 3.13
author: Serhiy Storchaka <[email protected]>
committer: serhiy-storchaka <[email protected]>
date: 2026-07-22T05:47:25Z
summary:

[3.13] gh-154416: Fix hanging test_tcflow on DragonFly BSD (GH-154417) 
(GH-154421)

TCIOFF and TCION transmit STOP and START characters, and closing the
pseudo-terminal waits until they are read.  Discard them.
(cherry picked from commit b0c945a27e708419c6845234ef633ce3f7c4c41e)

Co-authored-by: Claude Opus 4.8 <[email protected]>

files:
M Lib/test/test_termios.py

diff --git a/Lib/test/test_termios.py b/Lib/test/test_termios.py
index aa562b25cbcd3e..ca9d2afb76dbec 100644
--- a/Lib/test/test_termios.py
+++ b/Lib/test/test_termios.py
@@ -169,6 +169,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)
 
     def test_tcflow_errors(self):
         self.assertRaisesTermiosError(errno.EINVAL, termios.tcflow, self.fd, 
-1)

_______________________________________________
Python-checkins mailing list -- [email protected]
To unsubscribe send an email to [email protected]
https://mail.python.org/mailman3//lists/python-checkins.python.org
Member address: [email protected]

Reply via email to