[issue706263] print in pythonw raises silent exception when no console available

Christian Heimes report at bugs.python.org
Wed Jun 26 13:11:41 CEST 2013


Christian Heimes added the comment:

I recommend against changing the code so late in the Python 2.7 release cycle. A change in behavior is too confusing.
And it's not a bug but a design decision, too. Over five years ago I implement parts of the IO interaction with the operating system for Python 3.0. I deliberately did NOT port modifications to 2.6.

If you want to get Python 3.x style print() behavior in Python 2.7 you can have it already:

from __future__ import print_function
import sys
if sys.executable.endswith("pythonw.exe"):
    sys.stdout = sys.stdout = None

print("can handle sys.stdout = None just fine.")

----------
nosy: +christian.heimes
resolution:  -> wont fix
stage:  -> committed/rejected
status: open -> pending
type:  -> behavior

_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue706263>
_______________________________________


More information about the Python-bugs-list mailing list