Description of problem: Crash DNF when i type to terminal "sudo yum install gnome-wea" and type TAB key to completion command. Version-Release number of selected component: dnf-0.4.13-2.fc20 Additional info: reporter: libreport-2.1.12 cmdline: /usr/bin/python /usr/bin/dnf list --cacheonly executable: /usr/bin/dnf kernel: 3.12.10-300.fc20.x86_64 runlevel: N 5 type: Python uid: 0 Truncated backtrace: i18n.py:38:write:UnicodeEncodeError: 'ascii' codec can't encode character u'\xe9' in position 12: ordinal not in range(128) Traceback (most recent call last): File "/usr/bin/dnf", line 35, in <module> main.user_main(sys.argv[1:], exit_code=True) File "/usr/lib/python2.7/site-packages/dnf/cli/main.py", line 242, in user_main errcode = main(args) File "/usr/lib/python2.7/site-packages/dnf/cli/main.py", line 64, in main return _main(base, args) File "/usr/lib/python2.7/site-packages/dnf/cli/main.py", line 124, in _main cli.run() File "/usr/lib/python2.7/site-packages/dnf/cli/cli.py", line 1454, in run return self.command.run(self.base.extcmds) File "/usr/lib/python2.7/site-packages/dnf/cli/commands.py", line 567, in run return self._run('list', extcmds) File "/usr/lib/python2.7/site-packages/dnf/cli/commands.py", line 509, in _run '=' : clir, 'not in' : clie}) File "/usr/lib/python2.7/site-packages/dnf/cli/output.py", line 919, in listPkgs print('%s' % description) File "/usr/lib/python2.7/site-packages/dnf/i18n.py", line 38, in write self.stream.write(s.decode(self.encoding, 'replace')) UnicodeEncodeError: 'ascii' codec can't encode character u'\xe9' in position 12: ordinal not in range(128) Local variables in innermost frame: s: 'Nainstalovan\xc3\xa9 bal\xc3\xad\xc4\x8dky:' self: <dnf.i18n.UnicodeStream object at 0x221c690>
Created attachment 861078 [details] File: backtrace
Created attachment 861079 [details] File: environ
*** Bug 1064083 has been marked as a duplicate of this bug. ***
Hello, thank you for the report. I will take a look at it.
If I revert the change in the i18n.py at line 38: - self.stream.write(s) + self.stream.write(s.decode(self.encoding, 'replace')) I don't get the traceback anymore: Feb 12 18:42:20 rodin-666 dnf: Config time: 0.008 Feb 12 18:42:20 rodin-666 dnf: cachedir: /var/cache/dnf/x86_64/20 Feb 12 18:42:20 rodin-666 dnf: dnf version: 0.4.13 Feb 12 18:42:20 rodin-666 dnf: Création des fichiers de cache pour tous les fichiers de méta données. Feb 12 18:42:20 rodin-666 dnf: Metadata cache refreshed recently. Feb 12 18:42:20 rodin-666 systemd: Started dnf makecache. With the commit: Feb 12 18:45:59 rodin-666 systemd: Starting dnf makecache... Feb 12 18:45:59 rodin-666 dnf: Config time: 0.008 Feb 12 18:45:59 rodin-666 dnf: cachedir: /var/cache/dnf/x86_64/20 Feb 12 18:45:59 rodin-666 dnf: dnf version: 0.4.13 Feb 12 18:45:59 rodin-666 dnf: Traceback (most recent call last): Feb 12 18:45:59 rodin-666 dnf: File "/usr/lib64/python2.7/logging/__init__.py", line 874, in emit Feb 12 18:45:59 rodin-666 dnf: stream.write(fs % msg.encode("UTF-8")) Feb 12 18:45:59 rodin-666 dnf: File "/usr/lib/python2.7/site-packages/dnf/i18n.py", line 38, in write Feb 12 18:45:59 rodin-666 dnf: self.stream.write(s.decode(self.encoding, 'replace')) Feb 12 18:45:59 rodin-666 dnf: UnicodeEncodeError: 'ascii' codec can't encode character u'\xe9' in position 2: ordinal not in range(128) Feb 12 18:45:59 rodin-666 dnf: Logged from file commands.py, line 760 Feb 12 18:45:59 rodin-666 dnf: Metadata cache refreshed recently. Feb 12 18:45:59 rodin-666 systemd: Started dnf makecache. So it seems the traceback blocks when 's' is: "Création des fichiers de cache pour tous les fichiers de méta données." But I don't have a problem the reporter of the bug has: sudo yum install gnome-wea[TAB] , completes correctly sudo dnf install gnome-wea[TAB] , just does not complete
really don't know if that can help, but with: + if isinstance(s, unicode): self.stream.write(s.decode(self.encoding, 'replace')) + else: + self.stream.write(s) it doesn't do the traceback, so it seems to go to the "else" at this point.
The reproducibility depends on which encoding uses the stdout stream. Fixed upstream by 4c996e8f10300cde868eb74f187b85edf51a5ec8.
dnf-0.4.14-1.fc20 has been submitted as an update for Fedora 20. https://admin.fedoraproject.org/updates/dnf-0.4.14-1.fc20
This update solves this issue for me, thanks
Package dnf-0.4.14-1.fc20: * should fix your issue, * was pushed to the Fedora 20 testing repository, * should be available at your local mirror within two days. Update it with: # su -c 'yum update --enablerepo=updates-testing dnf-0.4.14-1.fc20' as soon as you are able to. Please go to the following url: https://admin.fedoraproject.org/updates/FEDORA-2014-2471/dnf-0.4.14-1.fc20 then log in and leave karma (feedback).
Bug looks fixed in new version. Karma it. Thanks.
dnf-0.4.14-1.fc20 has been pushed to the Fedora 20 stable repository. If problems still persist, please make note of it in this bug report.
*** Bug 1066648 has been marked as a duplicate of this bug. ***