Open egnor opened 5 months ago
Hello @egnor, thank you for the suggestion!
We are already tracking the request to send error messages to stderr (see e.g. https://github.com/espressif/esptool/issues/888). It will be implemented as a part of the next major release (v5.0) since it is a breaking change for current scripts relying on reading the stdout output.
Operating System
(relevant to most)
Esptool Version
4.7 (applicable to all)
Python Version
3.12.3 (applicable to all)
Full Esptool Command Line that Was Run
No response
Esptool Output
What is the Expected Behaviour?
esptool should print the more-helpful error message on STDERR (which currently only goes to STDOUT):
More Information
Some fatal errors also print important messages the user should see https://github.com/espressif/esptool/blob/4394a658c40b73cc6d593797a42b665e68f84cf7/esptool/loader.py#L35 https://github.com/espressif/esptool/blob/4394a658c40b73cc6d593797a42b665e68f84cf7/esptool/loader.py#L61
However, these
print()
to stdout, and in many cases (e.g.arduino-cli
), esptool is run with stdout suppressed, so all you see is the native Python stack trace error.Probably instead of
print()
andraise
, these should raise an error with the error message, the way this does: https://github.com/espressif/esptool/blob/4394a658c40b73cc6d593797a42b665e68f84cf7/esptool/loader.py#L44Other Steps to Reproduce
No response