Bug 1193713

Summary: yum-cron traceback because locale setting
Product: [Fedora] Fedora Reporter: Milan Kerslager <milan.kerslager>
Component: yum-cronAssignee: Orphan Owner <extras-orphan>
Status: CLOSED EOL QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: 21CC: christian, extras-orphan, james.antill, thomas.oulevey
Target Milestone: ---   
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2015-12-02 09:12:11 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Description Flags
Patch to fix the issue in /usr/sbin/yum-cron none

Description Milan Kerslager 2015-02-17 23:43:12 UTC
Created attachment 992941 [details]
Patch to fix the issue in /usr/sbin/yum-cron

I installed the system with my language locale settings (LANG=cs_CZ.utf8).

Sometimes, yum-cron-hourly emits this traceback to my email box:

Traceback (most recent call last):
  File "/usr/sbin/yum-cron", line 711, in <module>
  File "/usr/sbin/yum-cron", line 708, in main
  File "/usr/sbin/yum-cron", line 631, in updatesCheck
  File "/usr/sbin/yum-cron", line 582, in installUpdates
  File "/usr/sbin/yum-cron", line 694, in emitMessages
    map(lambda x: x.sendMessages(), self.emitters)
  File "/usr/sbin/yum-cron", line 694, in <lambda>
    map(lambda x: x.sendMessages(), self.emitters)
  File "/usr/sbin/yum-cron", line 227, in sendMessages
    msg = MIMEText(''.join(self.output))
  File "/usr/lib64/python2.7/email/mime/text.py", line 30, in __init__
    self.set_payload(_text, _charset)
  File "/usr/lib64/python2.7/email/message.py", line 226, in set_payload
  File "/usr/lib64/python2.7/email/message.py", line 262, in set_charset
    self._payload = self._payload.encode(charset.output_charset)
UnicodeEncodeError: 'ascii' codec can't encode characters in position 199-200:
ordinal not in range(128)

Steps to Reproduce: 
Set global locale other to English:

# cat /etc/locale.conf

Set your locale for current session to the same:
export $(cat /etc/locale.conf)

Run this:
/usr/sbin/yum-cron /etc/yum/yum-cron-hourly.conf

Patch is attached, see https://bugs.centos.org/view.php?id=7675

Comment 1 Fedora End Of Life 2015-11-04 13:33:30 UTC
This message is a reminder that Fedora 21 is nearing its end of life.
Approximately 4 (four) weeks from now Fedora will stop maintaining
and issuing updates for Fedora 21. It is Fedora's policy to close all
bug reports from releases that are no longer maintained. At that time
this bug will be closed as EOL if it remains open with a Fedora  'version'
of '21'.

Package Maintainer: If you wish for this bug to remain open because you
plan to fix it in a currently maintained version, simply change the 'version' 
to a later Fedora version.

Thank you for reporting this issue and we are sorry that we were not 
able to fix it before Fedora 21 is end of life. If you would still like 
to see this bug fixed and are able to reproduce it against a later version 
of Fedora, you are encouraged  change the 'version' to a later Fedora 
version prior this bug is closed as described in the policy above.

Although we aim to fix as many bugs as possible during every release's 
lifetime, sometimes those efforts are overtaken by events. Often a 
more recent Fedora release includes newer upstream software that fixes 
bugs or makes them obsolete.

Comment 2 Fedora End Of Life 2015-12-02 09:12:14 UTC
Fedora 21 changed to end-of-life (EOL) status on 2015-12-01. Fedora 21 is
no longer maintained, which means that it will not receive any further
security or bug fix updates. As a result we are closing this bug.

If you can reproduce this bug against a currently maintained version of
Fedora please feel free to reopen this bug against that version. If you
are unable to reopen this bug, please file a new report against the
current release. If you experience problems, please add a comment to this

Thank you for reporting this bug and we are sorry it could not be fixed.

Comment 3 christian 2016-01-31 22:38:47 UTC
Why is this one closed? It's not about Fedora, it's about CentOS 7 and so finally for RHEL 7, which still has this bug!

Comment 4 Milan Kerslager 2016-03-16 22:18:29 UTC
See proposed fix at bug #1202680