Bug 976002

Summary: dnf: NameError 'os'
Product: [Fedora] Fedora Reporter: Zbigniew JÄ™drzejewski-Szmek <zbyszek>
Component: dnfAssignee: Packaging Maintenance Team <packaging-team-maint>
Status: CLOSED DUPLICATE QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: 19CC: akozumpl, packaging-team-maint, pmatilai, pnemade
Target Milestone: ---   
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2013-06-20 05:14:13 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description Zbigniew Jędrzejewski-Szmek 2013-06-19 18:19:38 UTC
Description of problem:
Got my locale fucked up someway... and dnf throws a traceback:

$ locale
locale: Cannot set LC_ALL to default locale: No such file or directory
LANG=en_US.UTF-8
LC_CTYPE="en_US.UTF-8"
LC_NUMERIC=\'\'
LC_TIME=\'\'
LC_COLLATE="en_US.UTF-8"
LC_MONETARY=\'\'
LC_MESSAGES="en_US.UTF-8"
LC_PAPER=\'\'
LC_NAME="en_US.UTF-8"
LC_ADDRESS="en_US.UTF-8"
LC_TELEPHONE="en_US.UTF-8"
LC_MEASUREMENT=\'\'
LC_IDENTIFICATION="en_US.UTF-8"
LC_ALL=
$ 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

Version-Release number of selected component (if applicable):
dnf-0.3.7-1.gitf8bdc98.fc19.noarch

Comment 1 Panu Matilainen 2013-06-20 05:14:13 UTC

*** This bug has been marked as a duplicate of bug 974427 ***