Red Hat Bugzilla – Bug 1155877
[abrt] dnf: i18n.py:130:ucd:UnicodeDecodeError: 'ascii' codec can't decode byte 0xc3 in position 1: ordinal not in range(128)
Last modified: 2015-02-20 03:32:21 EST
Description of problem:
Setting locales to LANG=C makes DNF crash.
Version-Release number of selected component:
cmdline: /usr/bin/python -OO /bin/dnf history list all
runlevel: N 5
i18n.py:130:ucd:UnicodeDecodeError: 'ascii' codec can't decode byte 0xc3 in position 1: ordinal not in range(128)
Traceback (most recent call last):
File "/bin/dnf", line 36, in <module>
File "/usr/lib/python2.7/site-packages/dnf/cli/main.py", line 182, in user_main
errcode = main(args)
File "/usr/lib/python2.7/site-packages/dnf/cli/main.py", line 84, in main
return _main(base, args)
File "/usr/lib/python2.7/site-packages/dnf/cli/main.py", line 134, in _main
File "/usr/lib/python2.7/site-packages/dnf/cli/cli.py", line 1086, in run
File "/usr/lib/python2.7/site-packages/dnf/cli/commands/__init__.py", line 1205, in run
ret = self.output.historyListCmd(extcmds)
File "/usr/lib/python2.7/site-packages/dnf/cli/output.py", line 1353, in historyListCmd
name = self._pwd_ui_username(old.loginuid, 24)
File "/usr/lib/python2.7/site-packages/dnf/cli/output.py", line 1196, in _pwd_ui_username
fullname = _safe_split_0(ucd(user.pw_gecos), ';', 2)
File "/usr/lib/python2.7/site-packages/dnf/i18n.py", line 130, in ucd
return unicode(str(obj), _guess_encoding())
UnicodeDecodeError: 'ascii' codec can't decode byte 0xc3 in position 1: ordinal not in range(128)
Local variables in innermost frame:
obj: 'V\xc3\xadt Ondruch'
Created attachment 949636 [details]
Created attachment 949637 [details]
This might by due to my name, which contains diacritics. I discovered this issue due to bug #1155878 and the "history" works, but the "history all", which displays my full name does not.
Thanks for the report, right, it should print nicer error when someone tries to trick dnf with "LANG=C" and there's diacritics inside. The other option would be to continue as usual and replace these words with "<wrongly encoded word>" string or so.
(In reply to Jan Silhan from comment #4)
> and replace these words with "<wrongly encoded
> word>" string or so.
This is too big hammer IMO. I'm pretty sure there is some "standard" how to handle these cases, i.e. replace the character with '?' or simply "force encoding" which would display at least something partially useful.
*** Bug 1152732 has been marked as a duplicate of this bug. ***
dnf-plugins-core-0.1.5-1.fc21,hawkey-0.5.3-2.fc21,dnf-0.6.4-1.fc21 has been submitted as an update for Fedora 21.
Package hawkey-0.5.3-2.fc21, dnf-plugins-core-0.1.5-1.fc21, dnf-0.6.4-1.fc21:
* should fix your issue,
* was pushed to the Fedora 21 testing repository,
* should be available at your local mirror within two days.
Update it with:
# su -c 'yum update --enablerepo=updates-testing hawkey-0.5.3-2.fc21 dnf-plugins-core-0.1.5-1.fc21 dnf-0.6.4-1.fc21'
as soon as you are able to.
Please go to the following url:
then log in and leave karma (feedback).
hawkey-0.5.3-2.fc21, dnf-plugins-core-0.1.5-1.fc21, dnf-0.6.4-1.fc21 has been pushed to the Fedora 21 stable repository. If problems still persist, please make note of it in this bug report.