You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
when pyserial is not installed, you see on STDERR (if stdout is filtered):
Traceback (most recent call last):
File "/home/egnor/source/gadget_play/pintest/build/arduino/internal/esp32_esptool_py_4.5.1_7c51dd92fc1b703e/esptool.py", line 31, in<module>
import esptool
File "/home/egnor/source/gadget_play/pintest/build/arduino/internal/esp32_esptool_py_4.5.1_7c51dd92fc1b703e/esptool/__init__.py", line 41, in<module>
from esptool.cmds import (
File "/home/egnor/source/gadget_play/pintest/build/arduino/internal/esp32_esptool_py_4.5.1_7c51dd92fc1b703e/esptool/cmds.py", line 14, in<module>
from .bin_image import ELFFile, ImageSegment, LoadFirmwareImage
File "/home/egnor/source/gadget_play/pintest/build/arduino/internal/esp32_esptool_py_4.5.1_7c51dd92fc1b703e/esptool/bin_image.py", line 14, in<module>
from .loader import ESPLoader
File "/home/egnor/source/gadget_play/pintest/build/arduino/internal/esp32_esptool_py_4.5.1_7c51dd92fc1b703e/esptool/loader.py", line 30, in<module>
import serial
ModuleNotFoundError: No module named 'serial'
What is the Expected Behaviour?
esptool should print the more-helpful error message on STDERR (which currently only goes to STDOUT):
Pyserial is not installed for [python binary]. Check the README for installation instructions.
More Information
Some fatal errors also print important messages the user should see
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() and raise, these should raise an error with the error message, the way this does:
github-actionsbot
changed the title
Important fatal errors should print to stderr
Important fatal errors should print to stderr (ESPTOOL-863)
May 26, 2024
We are already tracking the request to send error messages to stderr (see e.g. #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
esptool/esptool/loader.py
Line 35 in 4394a65
esptool/esptool/loader.py
Line 61 in 4394a65
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:esptool/esptool/loader.py
Line 44 in 4394a65
Other Steps to Reproduce
No response
The text was updated successfully, but these errors were encountered: