Skip to content

Commit 566d678

Browse files
[3.15] gh-154416: Fix hanging test_tcflow on DragonFly BSD (GH-154417) (GH-154423)
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 35560dc commit 566d678

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
@@ -180,6 +180,9 @@ def test_tcflow(self):
180180
termios.tcflow(self.fd, termios.TCOON)
181181
termios.tcflow(self.fd, termios.TCIOFF)
182182
termios.tcflow(self.fd, termios.TCION)
183+
# Discard the transmitted STOP and START characters,
184+
# otherwise closing the pseudo-terminal can block.
185+
termios.tcflush(self.fd, termios.TCOFLUSH)
183186

184187
@support.skip_android_selinux('tcflow')
185188
def test_tcflow_errors(self):

0 commit comments

Comments
 (0)