Skip to content

Commit 078323f

Browse files
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 <noreply@anthropic.com>
1 parent f1730dd commit 078323f

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
@@ -194,6 +194,9 @@ def test_tcflow(self):
194194
termios.tcflow(self.fd, termios.TCOON)
195195
termios.tcflow(self.fd, termios.TCIOFF)
196196
termios.tcflow(self.fd, termios.TCION)
197+
# Discard the transmitted STOP and START characters,
198+
# otherwise closing the pseudo-terminal can block.
199+
termios.tcflush(self.fd, termios.TCOFLUSH)
197200

198201
@support.skip_android_selinux('tcflow')
199202
def test_tcflow_errors(self):

0 commit comments

Comments
 (0)