Red Hat Bugzilla – Bug 1144003
[abrt] dnf: download.py:181:_get_query_source:TypeError: 'NoneType' object has no attribute '__getitem__'
Last modified: 2014-12-13 04:53:59 EST
Description of problem:
dnf download ruby193 --source
Okay, ruby193 wasn't in the repo, but it should do something better than give a traceback.
Version-Release number of selected component:
cmdline: /usr/bin/python -OO /usr/bin/dnf download ruby193 --source
runlevel: N 5
download.py:181:_get_query_source:TypeError: 'NoneType' object has no attribute '__getitem__'
Traceback (most recent call last):
File "/usr/bin/dnf", line 36, in <module>
File "/usr/lib/python2.7/site-packages/dnf/cli/main.py", line 200, in user_main
errcode = main(args)
File "/usr/lib/python2.7/site-packages/dnf/cli/main.py", line 83, in main
return _main(base, args)
File "/usr/lib/python2.7/site-packages/dnf/cli/main.py", line 133, in _main
File "/usr/lib/python2.7/site-packages/dnf/cli/cli.py", line 1171, in run
File "/usr/lib/python2.7/site-packages/dnf-plugins/download.py", line 84, in run
locations = self._download_source(self.opts.packages)
File "/usr/lib/python2.7/site-packages/dnf-plugins/download.py", line 111, in _download_source
pkgs = self._get_packages(source_pkgs, source=True)
File "/usr/lib/python2.7/site-packages/dnf-plugins/download.py", line 119, in _get_packages
queries = map(self._get_query_source, pkg_specs)
File "/usr/lib/python2.7/site-packages/dnf-plugins/download.py", line 181, in _get_query_source
pkg_spec = pkg_spec[:-4] # skip the .rpm
TypeError: 'NoneType' object has no attribute '__getitem__'
Local variables in innermost frame:
self: <dnf.plugin.dynamic.download.DownloadCommand object at 0x1e61410>
Created attachment 938869 [details]
Created attachment 938870 [details]
I think there is no such traceback on Fedora 21. I tried to reproduce this as
$ sudo dnf download ruby193 --source
enabled fedora-source repository
Fedora 21 - Source 225 kB/s | 5.4 MB 00:24
and no output as it didn't find srpm ruby193
I haven't reproduced it either - no traceback in f20 with the same packages as reporter.
Do you know what's going on, Tim? Would you mind taking it, please?
I will take a look
Look a little strange, this will only happen if no sourcerpm is defined for a given package.
I have made a fix, so the plugin don't traceback in this case
dnf-0.6.3-2.fc21,dnf-plugins-core-0.1.4-1.fc21,hawkey-0.5.2-1.fc21 has been submitted as an update for Fedora 21.
Package dnf-0.6.3-2.fc21, hawkey-0.5.2-1.fc21, dnf-plugins-core-0.1.4-1.fc21:
* should fix your issue,
* was pushed to the Fedora 21 testing repository,
* should be available at your local mirror within two days.
Update it with:
# su -c 'yum update --enablerepo=updates-testing dnf-0.6.3-2.fc21 hawkey-0.5.2-1.fc21 dnf-plugins-core-0.1.4-1.fc21'
as soon as you are able to.
Please go to the following url:
then log in and leave karma (feedback).
dnf-0.6.3-2.fc21, hawkey-0.5.2-1.fc21, dnf-plugins-core-0.1.4-1.fc21 has been pushed to the Fedora 21 stable repository. If problems still persist, please make note of it in this bug report.