Bug 1215560 - [abrt] dnf: i18n.py:165:exact_width:TypeError: 'NoneType' object is not iterable
Summary: [abrt] dnf: i18n.py:165:exact_width:TypeError: 'NoneType' object is not iterable
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Fedora
Classification: Fedora
Component: dnf
Version: 21
Hardware: x86_64
OS: Unspecified
unspecified
unspecified
Target Milestone: ---
Assignee: Honza Silhan
QA Contact: Fedora Extras Quality Assurance
URL: https://retrace.fedoraproject.org/faf...
Whiteboard: abrt_hash:878703c9f2aebe32b2bc728fcc5...
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2015-04-27 06:37 UTC by Hedayat Vatankhah
Modified: 2015-05-28 10:11 UTC (History)
7 users (show)

Fixed In Version: dnf-plugins-core-0.1.7-1.fc22
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2015-05-08 07:27:06 UTC
Type: ---
Embargoed:


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

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.


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