Red Hat Bugzilla – 714113 – [abrt] yum-3.2.27-14.el6: up2dateLog.py:57:write_log:UnicodeEncodeError: 'ascii' codec can't encode characters in position 0-24: ordinal not in range(128)
Note: This bug is displayed in read-only format because
the product is no longer active in Red Hat Bugzilla.
RHEL Engineering is moving the tracking of its product development work on RHEL 6 through RHEL 9 to Red Hat Jira (issues.redhat.com). If you're a Red Hat customer, please continue to file support cases via the Red Hat customer portal. If you're not, please head to the "RHEL project" in Red Hat Jira and file new tickets here. Individual Bugzilla bugs in the statuses "NEW", "ASSIGNED", and "POST" are being migrated throughout September 2023. Bugs of Red Hat partners with an assigned Engineering Partner Manager (EPM) are migrated in late September as per pre-agreed dates. Bugs against components "kernel", "kernel-rt", and "kpatch" are only migrated if still in "NEW" or "ASSIGNED". If you cannot log in to RH Jira, please consult article #7032570. That failing, please send an e-mail to the RH Jira admins at rh-issues@redhat.com to troubleshoot your issue as a user management inquiry. The email creates a ServiceNow ticket with Red Hat. Individual Bugzilla bugs that are migrated will be moved to status "CLOSED", resolution "MIGRATED", and set with "MigratedToJIRA" in "Keywords". The link to the successor Jira issue will be found under "Links", have a little "two-footprint" icon next to it, and direct you to the "RHEL project" in Red Hat Jira (issue links are of type "https://issues.redhat.com/browse/RHEL-XXXX", where "X" is a digit). This same link will be available in a blue banner at the top of the page informing you that that bug has been migrated.
[abrt] yum-3.2.27-14.el6: up2dateLog.py:57:write_log:UnicodeEncodeError: 'ascii' codec can't encode characters in position 0-24: ordinal not in range(128)
Prior to this update, the presence of a UTF-8 character in an error or log message caused rhnplugin to terminate unexpectedly with a traceback. Such messages are now printed as expected.
DescriptionRed Hat Case Diagnostics
2011-06-17 11:29:04 UTC
This description generated by Andreas from an ABRT report
architecture: x86_64
cmdline: /usr/bin/python /usr/bin/yum install libtiff-devel
component: yum
executable: /usr/bin/yum
kernel: 2.6.32-71.el6.x86_64
package: yum-3.2.27-14.el6
reason: up2dateLog.py:57:write_log:UnicodeEncodeError: 'ascii' codec can't encode characters in position 0-24: ordinal not in range(128)
release: Red Hat Enterprise Linux Workstation release 6.1 (Santiago)
reproduce: 1.yum install libtiff-develを実行したら発生
2.
3.
time: 1308342371
uid: 0
backtrace: up2dateLog.py:57:write_log:UnicodeEncodeError: 'ascii' codec can't encode characters in position 0-24: ordinal not in range(128)
Traceback (most recent call last):
File "/usr/bin/yum", line 29, in <module>
yummain.user_main(sys.argv[1:], exit_code=True)
File "/usr/share/yum-cli/yummain.py", line 274, in user_main
errcode = main(args)
File "/usr/share/yum-cli/yummain.py", line 211, in main
return_code = base.doTransaction()
File "/usr/share/yum-cli/cli.py", line 584, in doTransaction
resultobject = self.runTransaction(cb=cb)
File "/usr/lib/python2.6/site-packages/yum/__init__.py", line 1527, in runTransaction
self.plugins.run('posttrans')
File "/usr/lib/python2.6/site-packages/yum/plugins.py", line 184, in run
func(conduitcls(self, self.base, conf, **kwargs))
File "/usr/share/yum-plugins/rhnplugin.py", line 221, in posttrans_hook
str(e))
File "/usr/share/rhn/up2date_client/up2dateErrors.py", line 179, in __repr__
log.log_me(msg)
File "/usr/share/rhn/up2date_client/up2dateLog.py", line 37, in log_me
self.write_log(s)
File "/usr/share/rhn/up2date_client/up2dateLog.py", line 57, in write_log
msg = "%s %s\n" % (self.log_info, str(s))
UnicodeEncodeError: 'ascii' codec can't encode characters in position 0-24: ordinal not in range(128)
Local variables in innermost frame:
s: u'\u30b5\u30fc\u30d0\u3068\u306e\u901a\u4fe1\u4e2d\u306b\u30a8\u30e9\u30fc\u304c\u767a\u751f\u3057\u307e\u3057\u305f\u3002\u30e1\u30c3\u30bb\u30fc\u30b8:\nConnection timed out on readline'
log_file: <open file '/var/log/up2date', mode 'a' at 0x48cf540>
log_name: '/var/log/up2date'
self: <up2date_client.up2dateLog.Log instance at 0x2f9c9e0>
Comment 2Red Hat Case Diagnostics
2011-06-17 11:29:39 UTC
Backported to CLIENT_RHEL-6 as
commit 159c638cdf862afbf8cd14fad1028e21aa1dc743
714113 - handle writing unicode to log file (cherry picked from commit 400df68c3498f
Technical note added. If any revisions are required, please edit the "Technical Notes" field
accordingly. All revisions will be proofread by the Engineering Content Services team.
New Contents:
yum-rhn-plugin did not like utf8 log messages and they caused tracebacks.
It's been fixed to be able to print utf8 messages to log file.
Comment 15Jaromir Hradilek
2011-10-27 16:29:25 UTC
Technical note updated. If any revisions are required, please edit the "Technical Notes" field
accordingly. All revisions will be proofread by the Engineering Content Services team.
Diffed Contents:
@@ -1,3 +1 @@
-yum-rhn-plugin did not like utf8 log messages and they caused tracebacks.
+Prior to this update, the presence of a UTF-8 character in an error or log message caused rhnplugin to terminate unexpectedly with a traceback. Such messages are now printed as expected.-
-It's been fixed to be able to print utf8 messages to log file.
Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.
For information on the advisory, and where to find the updated
files, follow the link below.
If the solution does not work for you, open a new bug report.
http://rhn.redhat.com/errata/RHBA-2011-1664.html
This description generated by Andreas from an ABRT report architecture: x86_64 cmdline: /usr/bin/python /usr/bin/yum install libtiff-devel component: yum executable: /usr/bin/yum kernel: 2.6.32-71.el6.x86_64 package: yum-3.2.27-14.el6 reason: up2dateLog.py:57:write_log:UnicodeEncodeError: 'ascii' codec can't encode characters in position 0-24: ordinal not in range(128) release: Red Hat Enterprise Linux Workstation release 6.1 (Santiago) reproduce: 1.yum install libtiff-develを実行したら発生 2. 3. time: 1308342371 uid: 0 backtrace: up2dateLog.py:57:write_log:UnicodeEncodeError: 'ascii' codec can't encode characters in position 0-24: ordinal not in range(128) Traceback (most recent call last): File "/usr/bin/yum", line 29, in <module> yummain.user_main(sys.argv[1:], exit_code=True) File "/usr/share/yum-cli/yummain.py", line 274, in user_main errcode = main(args) File "/usr/share/yum-cli/yummain.py", line 211, in main return_code = base.doTransaction() File "/usr/share/yum-cli/cli.py", line 584, in doTransaction resultobject = self.runTransaction(cb=cb) File "/usr/lib/python2.6/site-packages/yum/__init__.py", line 1527, in runTransaction self.plugins.run('posttrans') File "/usr/lib/python2.6/site-packages/yum/plugins.py", line 184, in run func(conduitcls(self, self.base, conf, **kwargs)) File "/usr/share/yum-plugins/rhnplugin.py", line 221, in posttrans_hook str(e)) File "/usr/share/rhn/up2date_client/up2dateErrors.py", line 179, in __repr__ log.log_me(msg) File "/usr/share/rhn/up2date_client/up2dateLog.py", line 37, in log_me self.write_log(s) File "/usr/share/rhn/up2date_client/up2dateLog.py", line 57, in write_log msg = "%s %s\n" % (self.log_info, str(s)) UnicodeEncodeError: 'ascii' codec can't encode characters in position 0-24: ordinal not in range(128) Local variables in innermost frame: s: u'\u30b5\u30fc\u30d0\u3068\u306e\u901a\u4fe1\u4e2d\u306b\u30a8\u30e9\u30fc\u304c\u767a\u751f\u3057\u307e\u3057\u305f\u3002\u30e1\u30c3\u30bb\u30fc\u30b8:\nConnection timed out on readline' log_file: <open file '/var/log/up2date', mode 'a' at 0x48cf540> log_name: '/var/log/up2date' self: <up2date_client.up2dateLog.Log instance at 0x2f9c9e0>