New submission from Thomas Ryschawy <thomasotto.rysch...@emerson.com>:

It seems to be known that in case of a Windows GUI app that isn’t connected to 
a console sys.stderr can be None. See the Note on 
http://docs.python.org/py3k/library/sys.html: Under some conditions stdin, 
stdout and stderr as well as the original values __stdin__, __stdout__ and 
__stderr__ can be None. It is usually the case for Windows GUI apps that aren’t 
connected to a console and Python apps started with pythonw.
In combination with logging this leads to an issue similar to issue #5971. In 
my case sys.stderr is None and File: lib\logging\__init__.py, Class: Handler, 
Method: handleError raises AttributeError: 'NoneType' object has no attribute 
'write'.
A 'simple' solution would be to check if sys.stderr is not None. In case it is 
None handleError must not call traceback.print_exception() and not directly 
write to sys.stderr.

----------
components: Library (Lib)
files: traceback.txt
messages: 151462
nosy: ThomasRyschawy
priority: normal
severity: normal
status: open
title: logging.Handler.handlerError() may raise AttributeError in 
traceback.print_exception()
type: behavior
versions: Python 2.6, Python 2.7, Python 3.1, Python 3.2, Python 3.3, Python 3.4
Added file: http://bugs.python.org/file24263/traceback.txt

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

Reply via email to