Fedora Account System
Red Hat Associate
Red Hat Customer
Since the most recent set of updates on Fedora 19, dnf errors out and produces the following backtrace for every command I try: $ sudo dnf update Failed to set locale, defaulting to C Traceback (most recent call last): File "/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 304, in user_$ errcode = main(args) File "/usr/lib/python2.7/site-packages/dnf/cli/main.py", line 39, in main _main(base, args) File "/usr/lib/python2.7/site-packages/dnf/cli/main.py", line 44, in _main dnf.i18n.setup_locale() File "/usr/lib/python2.7/site-packages/dnf/i18n.py", line 53, in setup_loca$ os.environ['LC_ALL'] = 'C' NameError: global name 'os' is not defineded Using the following versions: $ rpm -q hawkey libsolv dnf python hawkey-0.3.13-2.git15db39f.fc19.i686 libsolv-0.3.0-3.git7399ad1.fc19.i686 dnf-0.3.7-1.gitf8bdc98.fc19.noarch python-2.7.5-1.fc19.i686 I'm not too familiar with Python, but the backtrace seems to suggest that it's related to locale settings. My /etc/locale.conf was originally set manually to: LANG=en_GB.utf8 I tried setting it via GNOME control panel to see if it made any difference but it came up with the same error and the following /etc/locale.conf: LANG=en_GB.utf8 LC_NUMERIC=en_GB.UTF-8 LC_TIME=en_GB.UTF-8 LC_MONETARY=en_GB.UTF-8 LC_PAPER=en_GB.UTF-8 LC_MEASUREMENT=en_GB.UTF-8 Any debugging help from someone more knowledgeable about Python/dnf would be appreciated.
Sorry, that backtrace got mangled by my editor. It was supposed to be: $ sudo dnf update Failed to set locale, defaulting to C Traceback (most recent call last): File "/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 304, in user_main errcode = main(args) File "/usr/lib/python2.7/site-packages/dnf/cli/main.py", line 39, in main _main(base, args) File "/usr/lib/python2.7/site-packages/dnf/cli/main.py", line 44, in _main dnf.i18n.setup_locale() File "/usr/lib/python2.7/site-packages/dnf/i18n.py", line 53, in setup_locale os.environ['LC_ALL'] = 'C' NameError: global name 'os' is not defined
Adding "import os" to i18n.py seems to fix it.
This is triggered each time python fails to set the locale (perhaps because the respective locale files are not present on the system). importing the 'os' module indeed fixes this for the fallback scenario. Fixed by e11d928, this will be included with dnf-0.3.8.
*** Bug 976002 has been marked as a duplicate of this bug. ***
libsolv-0.3.0-5.git228d412.fc19, librepo-0.0.4-2.fc19, hawkey-0.3.14-1.git78b3aa0.fc19, dnf-0.3.8-2.git85524ae.fc19 has been submitted as an update for Fedora 19. https://admin.fedoraproject.org/updates/libsolv-0.3.0-5.git228d412.fc19,dnf-0.3.8-2.git85524ae.fc19,hawkey-0.3.14-1.git78b3aa0.fc19,librepo-0.0.4-2.fc19
Package libsolv-0.3.0-5.git228d412.fc19, librepo-0.0.4-2.fc19, hawkey-0.3.14-1.git78b3aa0.fc19, dnf-0.3.8-2.git85524ae.fc19: * should fix your issue, * was pushed to the Fedora 19 testing repository, * should be available at your local mirror within two days. Update it with: # su -c 'yum update --enablerepo=updates-testing libsolv-0.3.0-5.git228d412.fc19 librepo-0.0.4-2.fc19 hawkey-0.3.14-1.git78b3aa0.fc19 dnf-0.3.8-2.git85524ae.fc19' as soon as you are able to. Please go to the following url: https://admin.fedoraproject.org/updates/FEDORA-2013-11602/libsolv-0.3.0-5.git228d412.fc19,dnf-0.3.8-2.git85524ae.fc19,hawkey-0.3.14-1.git78b3aa0.fc19,librepo-0.0.4-2.fc19 then log in and leave karma (feedback).
libsolv-0.3.0-5.git228d412.fc19, librepo-0.0.4-2.fc19, hawkey-0.3.14-1.git78b3aa0.fc19, dnf-0.3.8-2.git85524ae.fc19 has been pushed to the Fedora 19 stable repository. If problems still persist, please make note of it in this bug report.