Description of problem: dnf migrate Version-Release number of selected component: python-dnf-1.0.0-1.fc22 Additional info: reporter: libreport-2.5.1 cmdline: /usr/bin/python -OO /bin/dnf-2 migrate dso_list: python-dnf-plugins-extras-migrate-0.0.7-1.fc22.noarch executable: /bin/dnf-2 kernel: 4.0.2-300.fc22.x86_64 runlevel: N 5 type: Python uid: 0 Truncated backtrace: pycomp.py:88:write_to_file:UnicodeDecodeError: 'ascii' codec can't decode byte 0xc3 in position 24: ordinal not in range(128) Traceback (most recent call last): File "/bin/dnf-2", 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 185, 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 1077, in run return self.command.run(self.base.extcmds) File "/usr/lib/python2.7/site-packages/dnf-plugins/migrate.py", line 123, in run self.migrate_yumdb() File "/usr/lib/python2.7/site-packages/dnf-plugins/migrate.py", line 289, in migrate_yumdb setattr(dnfdata, attribute, value) File "/usr/lib/python2.7/site-packages/dnf/yum/rpmsack.py", line 295, in __setattr__ self._write(attr, value) File "/usr/lib/python2.7/site-packages/dnf/yum/rpmsack.py", line 232, in _write dnf.pycomp.write_to_file(fo, value) File "/usr/lib/python2.7/site-packages/dnf/pycomp.py", line 88, in write_to_file f.write(content.encode('utf-8')) UnicodeDecodeError: 'ascii' codec can't decode byte 0xc3 in position 24: ordinal not in range(128) Local variables in innermost frame: content: '-y install /home/smael/T\xc3\xa9l\xc3\xa9chargements/skype-4.3.0.37-fedora.i586.rpm' f: <open file u'/var/lib/dnf/yumdb/t/f454a7a23f9b3e664fe07ac7de22123369c2cbf4-tcp_wrappers-libs-7.6-76.fc20-i686/command_line.tmp', mode 'w' at 0x7fb788f9f780>
Created attachment 1027298 [details] File: backtrace
Created attachment 1027299 [details] File: environ
Another user experienced a similar problem: dnf migrate reporter: libreport-2.5.1 cmdline: /usr/bin/python -OO /bin/dnf migrate event_log: 2015-05-19-18:09:59> (« report_uReport » terminé avec succès) executable: /bin/dnf kernel: 4.0.2-300.fc22.x86_64 package: dnf-1.0.0-1.fc22 reason: pycomp.py:88:write_to_file:UnicodeDecodeError: 'ascii' codec can't decode byte 0xc3 in position 24: ordinal not in range(128) runlevel: N 5 type: Python uid: 0
Thank you for the report. The `dnf.pycomp.write_to_file` function is apparently broken. It does not work for non-ascii byte strings. On the other hand, to be safe, I think that the migrate plugin should convert all the byte strings to Unicode strings. That would improve the plugin as well as work around the problem with `write_to_file`. We'll take a look.
Let's improve the wording: "as a side effect, it would work around the problem with `write_to_file` as well."
It apparently affects a lot of people, taking...
patch: https://github.com/rpm-software-management/dnf-plugins-extras/pull/28
dnf-plugins-extras-0.0.8-1.fc22 has been submitted as an update for Fedora 22. https://admin.fedoraproject.org/updates/dnf-plugins-extras-0.0.8-1.fc22
Package dnf-plugins-extras-0.0.8-1.fc22: * should fix your issue, * was pushed to the Fedora 22 testing repository, * should be available at your local mirror within two days. Update it with: # su -c 'yum update --enablerepo=updates-testing dnf-plugins-extras-0.0.8-1.fc22' as soon as you are able to. Please go to the following url: https://admin.fedoraproject.org/updates/FEDORA-2015-8740/dnf-plugins-extras-0.0.8-1.fc22 then log in and leave karma (feedback).
dnf-plugins-extras-0.0.8-1.fc22 has been pushed to the Fedora 22 stable repository. If problems still persist, please make note of it in this bug report.
*** Bug 1224049 has been marked as a duplicate of this bug. ***