Skip to content

Commit

Permalink
Correct encoding of tracebacks.
Browse files Browse the repository at this point in the history
Passing the traceback text through json.dumps() will escape all newline characters.
on_failure() should return a string so there is no need to encode.
  • Loading branch information
Stephen Pascoe authored and Stephen Pascoe committed Sep 15, 2015
1 parent 57e9eb5 commit 0ea890a
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions luigi/worker.py
Original file line number Diff line number Diff line change
Expand Up @@ -162,9 +162,8 @@ def run(self):
subject = "Luigi: %s FAILED" % self.task
exception = ex

raw_error_message = self.task.on_failure(ex)
notification_error_message = notifications.wrap_traceback(raw_error_message)
expl = json.dumps(raw_error_message)
expl = self.task.on_failure(ex)
notification_error_message = notifications.wrap_traceback(expl)

formatted_error_message = notifications.format_task_error(subject, self.task,
formatted_exception=notification_error_message)
Expand Down

0 comments on commit 0ea890a

Please sign in to comment.