Note: This is a public test instance of Red Hat Bugzilla. The data contained within is a snapshot of the live data so any changes you make will not be reflected in the production Bugzilla. Email is disabled so feel free to test any aspect of the site that you want. File any problems you find or give feedback at bugzilla.redhat.com.

Bug 1155877

Summary: [abrt] dnf: i18n.py:130:ucd:UnicodeDecodeError: 'ascii' codec can't decode byte 0xc3 in position 1: ordinal not in range(128)
Product: [Fedora] Fedora Reporter: Vít Ondruch <vondruch>
Component: dnfAssignee: Honza Silhan <jsilhan>
Status: CLOSED ERRATA QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: rawhideCC: akozumpl, heldwin, jsilhan, mluscon, pnemade, rholy, tla
Target Milestone: ---   
Target Release: ---   
Hardware: x86_64   
OS: Unspecified   
URL: https://retrace.fedoraproject.org/faf/reports/bthash/f45ddf0462e354041e43e40acff254a2792714dd
Whiteboard: abrt_hash:a4a066cf2ed9066f7237ca728d2548f6e519a8d0
Fixed In Version: hawkey-0.5.3-2.fc21 Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2015-02-20 08:32:21 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Attachments:
Description Flags
File: backtrace
none
File: environ none

Description Vít Ondruch 2014-10-23 04:52:38 UTC
Description of problem:
Setting locales to LANG=C makes DNF crash.

Version-Release number of selected component:
dnf-0.6.2-1.fc22

Additional info:
reporter:       libreport-2.3.0
cmdline:        /usr/bin/python -OO /bin/dnf history list all
executable:     /bin/dnf
kernel:         3.17.0-1.fc22.x86_64
runlevel:       N 5
type:           Python
uid:            0

Truncated backtrace:
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>
    main.user_main(sys.argv[1:], exit_code=True)
  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
    cli.run()
  File "/usr/lib/python2.7/site-packages/dnf/cli/cli.py", line 1086, in run
    return self.command.run(self.base.extcmds)
  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'

Comment 1 Vít Ondruch 2014-10-23 04:52:42 UTC
Created attachment 949636 [details]
File: backtrace

Comment 2 Vít Ondruch 2014-10-23 04:52:44 UTC
Created attachment 949637 [details]
File: environ

Comment 3 Vít Ondruch 2014-10-23 04:59:50 UTC
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.

Comment 4 Honza Silhan 2014-10-31 10:50:37 UTC
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.

Comment 5 Vít Ondruch 2014-10-31 11:03:04 UTC
(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.

Comment 6 Honza Silhan 2014-12-09 16:06:10 UTC
*** Bug 1152732 has been marked as a duplicate of this bug. ***

Comment 7 Fedora Update System 2015-02-16 00:03:09 UTC
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.
https://admin.fedoraproject.org/updates/dnf-plugins-core-0.1.5-1.fc21,hawkey-0.5.3-2.fc21,dnf-0.6.4-1.fc21

Comment 8 Fedora Update System 2015-02-17 08:04:04 UTC
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:
https://admin.fedoraproject.org/updates/FEDORA-2015-2139/dnf-plugins-core-0.1.5-1.fc21,hawkey-0.5.3-2.fc21,dnf-0.6.4-1.fc21
then log in and leave karma (feedback).

Comment 9 Fedora Update System 2015-02-20 08:32:21 UTC
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.