Bug 1281284 - Bash completion broken in F23
Summary: Bash completion broken in F23
Keywords:
Status: CLOSED CURRENTRELEASE
Alias: None
Product: Fedora
Classification: Fedora
Component: dnf
Version: 23
Hardware: Unspecified
OS: Unspecified
unspecified
unspecified
Target Milestone: ---
Assignee: Packaging Maintenance Team
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2015-11-12 08:55 UTC by Gianluca Sforna
Modified: 2016-05-30 08:53 UTC (History)
7 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2016-05-30 08:53:01 UTC
Type: Bug
Embargoed:


Attachments (Terms of Use)

Description Gianluca Sforna 2015-11-12 08:55:19 UTC
Description of problem:

Every time I press <tab> on a dnf command line I get this:

$ dnf Traceback (most recent call last):
  File "<string>", line 1, in <module>
ImportError: No module named 'dnf'

Comment 1 Honza Silhan 2015-11-18 13:51:19 UTC
Thanks for the report. Can you post output of `rpm -q *dnf*`, please? Does `dnf-2 <tab>` or `dnf-3 <tab> works for you?

Comment 2 Gianluca Sforna 2015-11-19 13:46:37 UTC
Those gives me the same error, however I think I just found the culprit.

I have installed the anaconda python distribution (https://www.continuum.io/downloads)
and it seems the completer is using that python runtime instead of the system's one.

In fact, the file:
/usr/lib/python3.4/site-packages/dnf/cli/completion_helper.py

starts with #/usr/bin/env python

To avoid problems like this, you may want to turn it into an explicit call to the correct python runtime in the spec file; I usually do this with something like:

find python3 -name '*.py' | xargs sed -i '1s|^#!.*|#!%{__python3}|'

Comment 3 Honza Silhan 2015-11-23 12:28:22 UTC
#/usr/bin/env python line seems to me irrelevant - it's executed like this: "python2/3 completion_helper.py".

Can you post output of `rpm -q *dnf*`, please? We still can't reproduce the issue.

Comment 4 Gianluca Sforna 2015-11-24 14:48:08 UTC
Ok, this what I get:

$ rpm -q *dnf*
package *dnf* is not installed

I guess what you wanted to see is:

rpm -qa | grep "dnf"
dnf-yum-1.1.4-1.fc23.noarch
dnf-1.1.4-1.fc23.noarch
dnf-conf-1.1.4-1.fc23.noarch
dnf-plugins-core-0.1.14-1.fc23.noarch
python3-dnf-plugins-core-0.1.14-1.fc23.noarch
python3-dnf-1.1.4-1.fc23.noarch

Now, if you want to reproduce the issue, I suggest you just try installing the anaconda python distribution (I used the miniconda version here http://conda.pydata.org/docs/install/quick.html#linux-miniconda-install) then try it again after installation changed the PATH variable.

Comment 5 Tobias Jungel 2016-05-27 14:27:20 UTC
seems to be broken again and displaying the message of 'def enforce_api(C)':

$ dnf-2 ch
a              be             functions.     of             'plugins'      The            
and            check-update   api.html.      officially     release.       upcoming       
API            DNF            in             only           removed        use            
at             documentation  is             part           supported      will           
available      function       not            Please         the            


$ dnf-3 check
a              be             functions.     of             'plugins'      The            
and            check-update   api.html.      officially     release.       upcoming       
API            DNF            in             only           removed        use            
at             documentation  is             part           supported      will           
available      function       not            Please         the


$ sudo rpm -qa | grep dnf
dnf-yum-1.1.9-1.fc23.noarch
dnf-plugin-system-upgrade-0.7.1-1.fc23.noarch
dnf-1.1.9-1.fc23.noarch
python3-dnf-plugin-system-upgrade-0.7.1-1.fc23.noarch
dnf-langpacks-0.15.1-1.fc23.noarch
python2-dnf-plugins-core-0.1.21-1.fc23.noarch
dnf-conf-1.1.9-1.fc23.noarch
python3-dnf-plugins-core-0.1.21-1.fc23.noarch
dnf-plugins-core-0.1.21-1.fc23.noarch
python3-dnf-1.1.9-1.fc23.noarch
python2-dnf-1.1.9-1.fc23.noarch
python-dnf-plugins-extras-migrate-0.0.12-1.fc23.noarch
dnf-langpacks-conf-0.15.1-1.fc23.noarch
python-dnf-plugins-extras-common-0.0.12-1.fc23.noarch
python3-dnf-langpacks-0.15.1-1.fc23.noarch

Comment 6 Michal Luscon 2016-05-27 14:32:45 UTC
Please try this koji build - http://koji.fedoraproject.org/koji/buildinfo?buildID=768157 .

Comment 7 Tobias Jungel 2016-05-30 08:04:08 UTC
works like a charm (2 and 3)

Comment 8 Michal Luscon 2016-05-30 08:53:01 UTC
dnf-1.1.9-2.fc23 has been already pushed to stable - https://bodhi.fedoraproject.org/updates/FEDORA-2016-c641c8151b


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