Skip to content

Commit 9d4e852

Browse files
[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 b0c945a) Co-authored-by: Claude Opus 4.8 <noreply@anthropic.com>
1 parent f68ff87 commit 9d4e852

1 file changed

Lines changed: 3 additions & 0 deletions

File tree

Lib/test/test_termios.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -169,6 +169,9 @@ def test_tcflow(self):
169169
termios.tcflow(self.fd, termios.TCOON)
170170
termios.tcflow(self.fd, termios.TCIOFF)
171171
termios.tcflow(self.fd, termios.TCION)
172+
# Discard the transmitted STOP and START characters,
173+
# otherwise closing the pseudo-terminal can block.
174+
termios.tcflush(self.fd, termios.TCOFLUSH)
172175

173176
def test_tcflow_errors(self):
174177
self.assertRaisesTermiosError(errno.EINVAL, termios.tcflow, self.fd, -1)

0 commit comments

Comments
 (0)