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>
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):