You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The first statement of RainbowLoggingHandler._emit() is: import sys statement.
Importing libraries when python shutsdown raises the following exception:
--- Logging error ---
Traceback (most recent call last):
File "/python/lib/site_packages/rainbow_logging_handler/__init__.py", line 194, in emit
msg = self._encode(msg)
File "/python/lib/site_packages/rainbow_logging_handler/__init__.py", line 210, in _encode
import sys
ImportError: sys.meta_path is None, Python is likely shutting down
Call stack:
File "/python/app/foo.py", line 65, in __del__
self.close()
File "/python/lib/logging/__init__.py", line 1294, in debug
self._log(DEBUG, msg, args, **kwargs)
File "/python/lib/logging/__init__.py", line 1442, in _log
self.handle(record)
File "/python/lib/logging/__init__.py", line 1452, in handle
self.callHandlers(record)
File "/python/lib/logging/__init__.py", line 1514, in callHandlers
hdlr.handle(record)
File "/python/lib/logging/__init__.py", line 863, in handle
self.emit(record)
File "/python/lib/site_packages/rainbow_logging_handler/__init__.py", line 200, in emit
self.handleError(record)
Message: 'Closing somethid: %s'
Arguments: ('something')
Many libraries use logging statements just before python interpreter exits, e.g inside finalizers, and this causes an annoying cascade of log-failures at the exit of the application.
The solution is to move the import sys statement at the top of the rainbow_logging_handler/__init__.py file.
The text was updated successfully, but these errors were encountered:
ankostis
added a commit
to JRCSTU/allinone
that referenced
this issue
Jun 27, 2017
The first statement of
RainbowLoggingHandler._emit()
is:import sys
statement.Importing libraries when python shutsdown raises the following exception:
Many libraries use logging statements just before python interpreter exits, e.g inside finalizers, and this causes an annoying cascade of log-failures at the exit of the application.
The solution is to move the
import sys
statement at the top of therainbow_logging_handler/__init__.py
file.The text was updated successfully, but these errors were encountered: