Bug 1215560

Summary: [abrt] dnf: i18n.py:165:exact_width:TypeError: 'NoneType' object is not iterable
Product: [Fedora] Fedora Reporter: Hedayat Vatankhah <hedayatv>
Component: dnfAssignee: Honza Silhan <jsilhan>
Status: CLOSED ERRATA QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: 21CC: jsilhan, mluscon, pnemade, rholy, sylvain, tim.lauridsen, vmukhame
Target Milestone: ---   
Target Release: ---   
Hardware: x86_64   
OS: Unspecified   
URL: https://retrace.fedoraproject.org/faf/reports/bthash/4a0edd8a92174300382b152225ac6f1ce9961c07
Whiteboard: abrt_hash:878703c9f2aebe32b2bc728fcc56c481833ef747
Fixed In Version: dnf-plugins-core-0.1.7-1.fc22 Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2015-05-08 07:27:06 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 Hedayat Vatankhah 2015-04-27 06:37:16 UTC
Description of problem:
I run dnf repolist, and it crashes:
[root@hvlap hedayat]# dnf repolist
Using metadata from Mon Apr 20 22:53:42 2015
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 1064, in run
    return self.command.run(self.base.extcmds)
  File "/usr/lib/python2.7/site-packages/dnf/cli/commands/repolist.py", line 233, in run
    if nm_len < exact_width(rname):
  File "/usr/lib/python2.7/site-packages/dnf/i18n.py", line 165, in exact_width
    return sum(_exact_width_char(c) for c in msg)
TypeError: 'NoneType' object is not iterable


And this is my DNF packages:
dnf.noarch                                                       0.6.4-1.fc21                            @System
dnf-plugins-core.noarch                                          0.1.5-1.fc21                            @System
dnf-plugins-extras-common.noarch                                 0.0.4-1.fc21                            @System
dnf-plugins-extras-local.noarch                                  0.0.4-1.fc21

Version-Release number of selected component:
dnf-0.6.4-1.fc21

Additional info:
reporter:       libreport-2.3.0
cmdline:        /usr/bin/python -OO /bin/dnf -C repolist
executable:     /bin/dnf
kernel:         3.18.9-200.fc21.x86_64
runlevel:       N 5
type:           Python
uid:            0

Truncated backtrace:
i18n.py:165:exact_width:TypeError: 'NoneType' object is not iterable

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 1064, in run
    return self.command.run(self.base.extcmds)
  File "/usr/lib/python2.7/site-packages/dnf/cli/commands/repolist.py", line 233, in run
    if nm_len < exact_width(rname):
  File "/usr/lib/python2.7/site-packages/dnf/i18n.py", line 165, in exact_width
    return sum(_exact_width_char(c) for c in msg)
TypeError: 'NoneType' object is not iterable

Local variables in innermost frame:
msg: None

Comment 1 Hedayat Vatankhah 2015-04-27 06:37:20 UTC
Created attachment 1019240 [details]
File: backtrace

Comment 2 Hedayat Vatankhah 2015-04-27 06:37:22 UTC
Created attachment 1019241 [details]
File: environ

Comment 3 Radek Holy 2015-04-27 11:19:13 UTC
We've debugged this issue with someone else on IRC last week. Can you confirm that you are using the DNF's "local" plugin (from the community plugins package)? If that's true, the issue is that the plugin does not set "name" to the repository which it adds while the "repolist" command assumes that it will be set. There are two possible solutions:

1) Remove this assumption from the "repolist" command.
2) Document that the name is required and fix the "local" plugin.

As for a workaround, I'm afraid that the only possibility is to always run "repolist" with the plugin being disabled ("dnf --disableplugin=local repolist") in the meantime.

Thank you for the report.

Comment 4 Honza Silhan 2015-04-27 15:47:14 UTC
Fixed the other way. Repo.name (if not set) shares the repo ID value.

Comment 5 Hedayat Vatankhah 2015-04-27 18:03:38 UTC
Thanks. Yes, as I said I have dnf-plugins-extras-local package installed.

Comment 6 Fedora Update System 2015-05-02 13:49:30 UTC
dnf-plugins-core-0.1.7-1.fc22,hawkey-0.5.5-1.fc22,dnf-1.0.0-1.fc22 has been submitted as an update for Fedora 22.
https://admin.fedoraproject.org/updates/dnf-plugins-core-0.1.7-1.fc22,hawkey-0.5.5-1.fc22,dnf-1.0.0-1.fc22

Comment 7 Fedora Update System 2015-05-03 17:24:29 UTC
Package dnf-plugins-core-0.1.7-1.fc22, hawkey-0.5.5-1.fc22, dnf-1.0.0-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-core-0.1.7-1.fc22 hawkey-0.5.5-1.fc22 dnf-1.0.0-1.fc22'
as soon as you are able to.
Please go to the following url:
https://admin.fedoraproject.org/updates/FEDORA-2015-7483/dnf-plugins-core-0.1.7-1.fc22,hawkey-0.5.5-1.fc22,dnf-1.0.0-1.fc22
then log in and leave karma (feedback).

Comment 8 Fedora Update System 2015-05-08 07:27:06 UTC
dnf-plugins-core-0.1.7-1.fc22, hawkey-0.5.5-1.fc22, dnf-1.0.0-1.fc22 has been pushed to the Fedora 22 stable repository.  If problems still persist, please make note of it in this bug report.