mirror of
https://github.com/espressif/esp-idf
synced 2025-03-10 01:29:21 -04:00
Between 3.1.0 and 3.3.0, pyserial had thread cancellation implemented using a select, which blocked on the stdin and an auxiliary pipe. When thread had to be cancelled, a byte would be sent into the pipe, unblocking stdin. Unfortunately, this method suffers from a problem with using select on a StreamReader (which represents the decoder wrapped around stdin). In some cases, when the TTY sends an escape sequence in response to an escape sequence received from serial, this escape sequence will not be read from stdin until some key is pressed. In https://github.com/pyserial/pyserial/commit/cab3dab, this method was replaced with an TIOCSTI ioctl. This change makes sure we use the new cancellation method even if the script is running with older pyserial.