Bug 1215560 - [abrt] dnf: i18n.py:165:exact_width:TypeError: 'NoneType' object is not iterable
[abrt] dnf: i18n.py:165:exact_width:TypeError: 'NoneType' object is not iterable
Status: CLOSED ERRATA
Product: Fedora
Classification: Fedora
Component: dnf (Show other bugs)
21
x86_64 Unspecified
unspecified Severity unspecified
: ---
: ---
Assigned To: Honza Silhan
Fedora Extras Quality Assurance
https://retrace.fedoraproject.org/faf...
abrt_hash:878703c9f2aebe32b2bc728fcc5...
:
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2015-04-27 02:37 EDT by Hedayat Vatankhah
Modified: 2015-05-28 06:11 EDT (History)
7 users (show)

See Also:
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 03:27:06 EDT
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)
File: backtrace (968 bytes, text/plain)
2015-04-27 02:37 EDT, Hedayat Vatankhah
no flags Details
File: environ (2.74 KB, text/plain)
2015-04-27 02:37 EDT, Hedayat Vatankhah
no flags Details

  None (edit)
Description Hedayat Vatankhah 2015-04-27 02:37:16 EDT
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 02:37:20 EDT
Created attachment 1019240 [details]
File: backtrace
Comment 2 Hedayat Vatankhah 2015-04-27 02:37:22 EDT
Created attachment 1019241 [details]
File: environ
Comment 3 Radek Holy 2015-04-27 07:19:13 EDT
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 11:47:14 EDT
Fixed the other way. Repo.name (if not set) shares the repo ID value.
Comment 5 Hedayat Vatankhah 2015-04-27 14:03:38 EDT
Thanks. Yes, as I said I have dnf-plugins-extras-local package installed.
Comment 6 Fedora Update System 2015-05-02 09:49:30 EDT
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 13:24:29 EDT
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 03:27:06 EDT
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.

Note You need to log in before you can comment on or make changes to this bug.