From: Vinay Sajip Date: Fri, 20 Jan 2012 11:27:36 +0000 (+0000) Subject: Closes #13807: Merged fix from 3.1. X-Git-Tag: v3.2.3rc1~148 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=315a62befc54d5643c933852fb41066c91f3a32e;p=python Closes #13807: Merged fix from 3.1. --- 315a62befc54d5643c933852fb41066c91f3a32e diff --cc Lib/logging/__init__.py index 7dacddb066,f70dfb5239..5f73ec2255 --- a/Lib/logging/__init__.py +++ b/Lib/logging/__init__.py @@@ -881,13 -721,10 +881,13 @@@ class Handler(Filterer) You could, however, replace this with a custom handler if you wish. The record which was being processed is passed in to this method. """ - if raiseExceptions: + if raiseExceptions and sys.stderr: # see issue 13807 ei = sys.exc_info() try: - traceback.print_exception(ei[0], ei[1], ei[2], None, sys.stderr) + traceback.print_exception(ei[0], ei[1], ei[2], + None, sys.stderr) + sys.stderr.write('Logged from file %s, line %s\n' % ( + record.filename, record.lineno)) except IOError: pass # see issue 5971 finally: