kopia lustrzana https://github.com/espressif/esp-idf
Merge branch 'bugfix/idf_monitor_windows_console' into 'master'
idf_monitor: Ignore OS-level errors writing to Windows Console Closes IDF-810 See merge request espressif/esp-idf!5607pull/4613/head
commit
0929c91d1a
|
@ -899,10 +899,13 @@ if os.name == 'nt':
|
||||||
self.output.write(data.decode())
|
self.output.write(data.decode())
|
||||||
else:
|
else:
|
||||||
self.output.write(data)
|
self.output.write(data)
|
||||||
except IOError:
|
except (IOError, OSError):
|
||||||
# Windows 10 bug since the Fall Creators Update, sometimes writing to console randomly throws
|
# Windows 10 bug since the Fall Creators Update, sometimes writing to console randomly throws
|
||||||
# an exception (however, the character is still written to the screen)
|
# an exception (however, the character is still written to the screen)
|
||||||
# Ref https://github.com/espressif/esp-idf/issues/1136
|
# Ref https://github.com/espressif/esp-idf/issues/1163
|
||||||
|
#
|
||||||
|
# Also possible for Windows to throw an OSError error if the data is invalid for the console
|
||||||
|
# (garbage bytes, etc)
|
||||||
pass
|
pass
|
||||||
|
|
||||||
def write(self, data):
|
def write(self, data):
|
||||||
|
@ -939,7 +942,12 @@ if os.name == 'nt':
|
||||||
self.matched = b''
|
self.matched = b''
|
||||||
|
|
||||||
def flush(self):
|
def flush(self):
|
||||||
|
try:
|
||||||
self.output.flush()
|
self.output.flush()
|
||||||
|
except OSError:
|
||||||
|
# Account for Windows Console refusing to accept garbage bytes (serial noise, etc)
|
||||||
|
pass
|
||||||
|
|
||||||
|
|
||||||
if __name__ == "__main__":
|
if __name__ == "__main__":
|
||||||
main()
|
main()
|
||||||
|
|
Ładowanie…
Reference in New Issue