Bug 1281284 - Bash completion broken in F23
Bash completion broken in F23
Status: CLOSED CURRENTRELEASE
Product: Fedora
Classification: Fedora
Component: dnf (Show other bugs)
23
Unspecified Unspecified
unspecified Severity unspecified
: ---
: ---
Assigned To: packaging-team-maint
Fedora Extras Quality Assurance
:
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2015-11-12 03:55 EST by Gianluca Sforna
Modified: 2016-05-30 04:53 EDT (History)
7 users (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2016-05-30 04:53:01 EDT
Type: Bug
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)

  None (edit)
Description Gianluca Sforna 2015-11-12 03:55:19 EST
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 08:51:19 EST
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 08:46:37 EST
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 07:28:22 EST
#/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 09:48:08 EST
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 10:27:20 EDT
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 10:32:45 EDT
Please try this koji build - http://koji.fedoraproject.org/koji/buildinfo?buildID=768157 .
Comment 7 Tobias Jungel 2016-05-30 04:04:08 EDT
works like a charm (2 and 3)
Comment 8 Michal Luscon 2016-05-30 04:53:01 EDT
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.