Florian Bruhin added the comment:

The thing is the developer is not necessarely the one controlling if sys.stderr 
is None, sometimes the user is.

For example, see 
https://docs.python.org/3.4/using/windows.html#executing-scripts-without-the-python-launcher
 - an user might have decided to use pythonw by default.

This means there's an unexpected gotcha - if I want my application to still run 
under Windows when the user has changed the default, I first have to check 
sys.stderr before enabling faulthandler.

At the very least I think this should be documented in the faulthandler 
documentation. I noticed the issue when starting my application under Windows 
after using cx_Freeze on it, and as a developer wouldn't have expected (or 
thought about this) at all.

I don't feel like I'm the one to decide this properly though, and I'm uncertain 
what's the right choice, so what you say is probably right ;)

----------

_______________________________________
Python tracker <rep...@bugs.python.org>
<http://bugs.python.org/issue21497>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to