]> granicus.if.org Git - esp-idf/commitdiff
idf_monitor: Fix Windows 10 bug in cases where second console write also fails
authorAngus Gratton <angus@espressif.com>
Fri, 15 Dec 2017 05:45:44 +0000 (16:45 +1100)
committerAngus Gratton <gus@projectgus.com>
Fri, 15 Dec 2017 05:59:36 +0000 (16:59 +1100)
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

index 49e2b74b82864f1811660ef7b88b03be903c8bce..6bc63f7e3eae7c138731b06ae9b883a60963beab 100755 (executable)
@@ -563,8 +563,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):