mirror of
https://github.com/ansible/awx.git
synced 2026-03-11 06:29:31 -02:30
Fix bug where translated strings will cause log error to error (#11813)
* Fix bug where translated strings will cause log error to error * Use force_str for ensuring string
This commit is contained in:
@@ -10,6 +10,7 @@ from datetime import datetime
|
|||||||
# Django
|
# Django
|
||||||
from django.conf import settings
|
from django.conf import settings
|
||||||
from django.utils.timezone import now
|
from django.utils.timezone import now
|
||||||
|
from django.utils.encoding import force_str
|
||||||
|
|
||||||
# AWX
|
# AWX
|
||||||
from awx.main.exceptions import PostRunError
|
from awx.main.exceptions import PostRunError
|
||||||
@@ -42,7 +43,7 @@ class RSysLogHandler(logging.handlers.SysLogHandler):
|
|||||||
msg += exc.splitlines()[-1]
|
msg += exc.splitlines()[-1]
|
||||||
except Exception:
|
except Exception:
|
||||||
msg += exc
|
msg += exc
|
||||||
msg = '\n'.join([msg, record.msg, ''])
|
msg = '\n'.join([msg, force_str(record.msg), '']) # force_str used in case of translated strings
|
||||||
sys.stderr.write(msg)
|
sys.stderr.write(msg)
|
||||||
|
|
||||||
def emit(self, msg):
|
def emit(self, msg):
|
||||||
|
|||||||
Reference in New Issue
Block a user