Martin v. Löwis <mar...@v.loewis.de> added the comment: That pythonw suddenly closes is a separate issue: if pythonw attempts to write to stderr, it crashes. To get your example to "run" in pythonw.exe, try
pythonw.exe Lib\idlelib\idle.py 2> out.txt I think the behavior of pythonw terminating when it can't write to stderr is actually correct: an exception is raised on attempting to write to stderr, which then can be printed (because there is no stderr). So the real fault here is the traceback that python.exe reports. To fix this, I think rpc.py should learn to marshal exceptions back to the subprocess. Then the initial sys.stdout.write should raise a UnicodeError (which it currently doesn't, either). This would get into the displayhook, which would then run use sys_displayhook_unencodable to backslashescape the unsupported character. I'll attach a patch that at least makes the exception UnicodeEncodeError. ---------- keywords: +patch Added file: http://bugs.python.org/file24748/unicodeerror.diff _______________________________________ Python tracker <rep...@bugs.python.org> <http://bugs.python.org/issue14200> _______________________________________ _______________________________________________ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com