From b62e5a4b4e97662972a1ee4ec5451c71332d83ad Mon Sep 17 00:00:00 2001 From: Angus Gratton Date: Fri, 15 Dec 2017 16:45:44 +1100 Subject: [PATCH] idf_monitor: Fix Windows 10 bug in cases where second console write also fails Although in my tests the second write always passes, people have reported different results. Closes https://github.com/espressif/esp-idf/issues/1136 (again) --- tools/idf_monitor.py | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/tools/idf_monitor.py b/tools/idf_monitor.py index 21b59a103..ccaddffa1 100755 --- a/tools/idf_monitor.py +++ b/tools/idf_monitor.py @@ -592,8 +592,11 @@ if os.name == 'nt': self.output.write(b) except IOError: # Windows 10 bug since the Fall Creators Update, sometimes writing to console randomly fails - # (but always succeeds the second time, it seems.) Ref https://github.com/espressif/esp-idf/issues/1136 - self.output.write(b) + # (but usually succeeds the second time, it seems.) Ref https://github.com/espressif/esp-idf/issues/1136 + try: + self.output.write(b) + except IOError: + pass self.matched = b'' def flush(self):