Ver código fonte

Fixes unicode output in colored logs. Closes #427

Ask Solem 12 anos atrás
pai
commit
fcc432a131
1 arquivos alterados com 2 adições e 2 exclusões
  1. 2 2
      celery/utils/log.py

+ 2 - 2
celery/utils/log.py

@@ -17,7 +17,7 @@ import traceback
 from billiard import current_process, util as mputil
 from billiard import current_process, util as mputil
 from kombu.log import get_logger as _get_logger, LOG_LEVELS
 from kombu.log import get_logger as _get_logger, LOG_LEVELS
 
 
-from .encoding import safe_str, str_t
+from .encoding import safe_str
 from .term import colored
 from .term import colored
 
 
 _process_aware = False
 _process_aware = False
@@ -87,7 +87,7 @@ class ColorFormatter(logging.Formatter):
 
 
         if self.use_color and color:
         if self.use_color and color:
             try:
             try:
-                record.msg = safe_str(str_t(color(record.msg)))
+                record.msg = safe_str(color(record.msg))
             except Exception, exc:
             except Exception, exc:
                 record.msg = '<Unrepresentable %r: %r>' % (
                 record.msg = '<Unrepresentable %r: %r>' % (
                     type(record.msg), exc)
                     type(record.msg), exc)