Tools: Handle IO error in idf.py output capturing
Closes
@@ -240,10 +240,14 @@ class RunTool:
print(fit_text_in_terminal(output.strip('\n\r')), end='', file=output_stream)
async def read_stream() -> Optional[str]:
+ try:
output_b = await input_stream.readline()
- if not output_b:
- return None
return output_b.decode(errors='ignore')
+ except (asyncio.LimitOverrunError, asyncio.IncompleteReadError) as e:
+ print(e, file=sys.stderr)
+ return None
+ except AttributeError:
+ return None
async def read_interactive_stream() -> Optional[str]:
buffer = b''
