Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

sys.stdout may not be available in certain contexts (eg. pyinstaller headless, no stdout context) (ESPTOOL-1007) #1063

Open
brentpicasso opened this issue Feb 5, 2025 · 0 comments · May be fixed by #1064

Comments

@brentpicasso
Copy link

brentpicasso commented Feb 5, 2025

fix: guard against possible None sys.stdout

Operating System

Reproduces on windows

Esptool Version

4.8.1 and later

Python Version

3.11.x

Full Esptool Command Line that Was Run

N/A

Esptool Output

We are using esptool to flash firmware in the context of our app. 

This app runs on Kivy, and built with Pyinstaller. On windows, it appears that sys.stdout is not available (sys.stdout is None)

Under these conditions, esptool will crash when sys.stdout.flush() is called

What is the Expected Behaviour?

esptool should guard against this condition and not crash if sys.stdout is not available.

More Information

Reproduces on Windows with Kivy app built with pyinstaller

Other Steps to Reproduce

No response

@github-actions github-actions bot changed the title sys.stdout may not be available in certain contexts (eg. pyinstaller headless, no stdout context) sys.stdout may not be available in certain contexts (eg. pyinstaller headless, no stdout context) (ESPTOOL-1007) Feb 5, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
1 participant