[issue23016] uncatched exception in lib/warnings.py when executed with pythonw

2014-12-10 Thread STINNER Victor
STINNER Victor added the comment: warnings_stderr_none.patch looks good to me. It can be applied on Python 2.7, 3.4 and 3.5. -- ___ Python tracker ___ __

[issue23016] uncatched exception in lib/warnings.py when executed with pythonw

2014-12-09 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: I afraid this will silence unexpected errors. -- ___ Python tracker ___ ___ Python-bugs-list maili

[issue23016] uncatched exception in lib/warnings.py when executed with pythonw

2014-12-09 Thread STINNER Victor
STINNER Victor added the comment: + execpt: Please never use that, but "except Exception:" instead to not catch SystemExit or KeyboardInterrupt. -- nosy: +haypo ___ Python tracker ___

[issue23016] uncatched exception in lib/warnings.py when executed with pythonw

2014-12-09 Thread stockbsd Li
stockbsd Li added the comment: 1. py2 is unaffected, because stderr/stdout is not None in py2's pythonw and the catch works correctly. 2. as to py3, I prefer this patch: - execpt OSError: + execpt: -- ___ Python tracker

[issue23016] uncatched exception in lib/warnings.py when executed with pythonw

2014-12-09 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: Here is a patch. 2.7 is affected too. -- keywords: +patch nosy: +serhiy.storchaka stage: -> patch review type: crash -> behavior versions: +Python 2.7, Python 3.5 -Python 3.2, Python 3.3 Added file: http://bugs.python.org/file37396/warnings_stderr_non

[issue23016] uncatched exception in lib/warnings.py when executed with pythonw

2014-12-08 Thread stockbsd Li
New submission from stockbsd Li: in py3k, the following simple code will throw an uncatched exception when executed with pythonw: import warnings warnings.warn('test') the problem occurs in showarning function: in py3k's pythonw , stderr/stdout is set to None, so the file.write(...) statement