|
|
5ab7f2 |
diff --git a/yum-cron/yum-cron.py b/yum-cron/yum-cron.py
|
|
|
5ab7f2 |
index 23f36d38..fd593d62 100755
|
|
|
5ab7f2 |
--- a/yum-cron/yum-cron.py
|
|
|
5ab7f2 |
+++ b/yum-cron/yum-cron.py
|
|
|
5ab7f2 |
@@ -140,7 +140,11 @@ class UpdateEmitter(object):
|
|
|
5ab7f2 |
overridden by inheriting classes to emit the messages
|
|
|
5ab7f2 |
according to their individual methods.
|
|
|
5ab7f2 |
"""
|
|
|
5ab7f2 |
- pass
|
|
|
5ab7f2 |
+ # Convert any byte strings to unicode objects now (so that we avoid
|
|
|
5ab7f2 |
+ # implicit conversions with the "ascii" codec later when join()-ing the
|
|
|
5ab7f2 |
+ # strings, leading to tracebacks).
|
|
|
5ab7f2 |
+ self.output = [x.decode('utf-8') if isinstance(x, str) else x
|
|
|
5ab7f2 |
+ for x in self.output]
|
|
|
5ab7f2 |
|
|
|
5ab7f2 |
|
|
|
5ab7f2 |
class EmailEmitter(UpdateEmitter):
|
|
|
5ab7f2 |
@@ -220,6 +224,7 @@ class EmailEmitter(UpdateEmitter):
|
|
|
5ab7f2 |
"""Combine the stored messages that have been stored into a
|
|
|
5ab7f2 |
single email message, and send this message.
|
|
|
5ab7f2 |
"""
|
|
|
5ab7f2 |
+ super(EmailEmitter, self).sendMessages()
|
|
|
5ab7f2 |
# Don't send empty emails
|
|
|
5ab7f2 |
if not self.output:
|
|
|
5ab7f2 |
return
|
|
|
5ab7f2 |
@@ -262,6 +267,7 @@ class StdIOEmitter(UpdateEmitter):
|
|
|
5ab7f2 |
"""Combine the stored messages that have been stored into a
|
|
|
5ab7f2 |
single email message, and send this message to standard output.
|
|
|
5ab7f2 |
"""
|
|
|
5ab7f2 |
+ super(StdIOEmitter, self).sendMessages()
|
|
|
5ab7f2 |
# Don't print blank lines
|
|
|
5ab7f2 |
if not self.output:
|
|
|
5ab7f2 |
return
|