Bug 2359689
| Summary: | some completion scripts not working when python3-argcomplete is installed | ||
|---|---|---|---|
| Product: | [Fedora] Fedora | Reporter: | Remi Collet <fedora> |
| Component: | python-argcomplete | Assignee: | Miro Hrončok <mhroncok> |
| Status: | CLOSED ERRATA | QA Contact: | Fedora Extras Quality Assurance <extras-qa> |
| Severity: | medium | Docs Contact: | |
| Priority: | unspecified | ||
| Version: | 41 | CC: | chris, gui1ty, igor.raits, maxwell, mhroncok, mrunge, msrb, python-packagers-sig, steve.traylen, svashisht |
| Target Milestone: | --- | Keywords: | Reopened |
| Target Release: | --- | ||
| Hardware: | Unspecified | ||
| OS: | Linux | ||
| Whiteboard: | |||
| Fixed In Version: | python-argcomplete-3.6.2-2.fc43 python-argcomplete-3.6.2-2.fc42 python-argcomplete-3.6.2-2.fc41 python-argcomplete-3.6.2-2.fc40 | Doc Type: | --- |
| Doc Text: | Story Points: | --- | |
| Clone Of: | Environment: | ||
| Last Closed: | 2025-04-20 04:23:07 UTC | Type: | --- |
| Regression: | --- | Mount Type: | --- |
| Documentation: | --- | CRM: | |
| Verified Versions: | Category: | --- | |
| oVirt Team: | --- | RHEL 7.3 requirements from Atomic Host: | |
| Cloudforms Team: | --- | Target Upstream Version: | |
| Embargoed: | |||
|
Description
Remi Collet
2025-04-15 07:15:55 UTC
Reaffecting to python-argcomplete as the problem is related to /etc/bash_completion.d/_python-argcomplete With old python3-argcomplete it was working as expected (f39) Removing python3-argcomplete solves the issue (tested on F40 and F41) Version 3.6.2 in testing is also affected The problem is in
elif __python_argcomplete_run "${interpreter[@]}" -m argcomplete._check_console_script "$SCRIPT_NAME"; then
ARGCOMPLETE=1
As "/usr/bin/php -m" is a valid command (modules list)
So the problem (if I understand it correctly) is the combination of: 1. /etc/bash_completion.d/_python-argcomplete runs for everything 2. the script runs $interpeter -m argcomplete._check_console_script "$SCRIPT_NAME" (assuming $interpreter is some kind of Python) 3. php -m argcomplete._check_console_script "$SCRIPT_NAME" exists successfully 4. argcomplete takes over the completion for some php scripts correct? > correct?
Yes.
Still digging.
/etc/bash_completion.d/_python-argcomplete contains
complete -o default -o bashdefault -D -F _python_argcomplete_global
/usr/share/bash-completion/completions/pie contains
complete -F _sf_pie pie
According to "complete" man page
The -D option indicates that other supplied options and actions should apply to the ``default'' command completion;
that is, completion attempted on a command for which no completion has previously been defined.
So _python-argcomplete should not be used for pie, which has a completion defined
So maybe a bash-completion issue or a load order issue.
So a possible fix Moving _python-argcomplete from user directory (/etc) to system directory (/usr/) solves the load order issue mv /etc/bash_completion.d/_python-argcomplete /usr/share/bash-completion/completions/_python-argcomplete - pie completion works - virt-install (which use _python-argcomplete) works Moving to /usr breaks argcomplete entirely (which is perhaps why it solves this). See bz2211862. Fedora RPM-packaged scripts using argcompelte all have Python shebangs.
Hence, I wonder if getting rid of the entire book...
elif __python_argcomplete_run "${interpreter[@]}" -m argcomplete._check_console_script "$SCRIPT_NAME"; then
ARGCOMPLETE=1
fi
...(which is located in an elif branch for scripts without a Python shebang) would not be good enough for us, until an upstream solution is found.
As RHEL-10 is also affected, reported as https://issues.redhat.com/browse/RHEL-87652 Remi, please test the CI build of https://src.fedoraproject.org/rpms/python-argcomplete/pull-request/40 -- I'll check if it breaks Python scripts using argcomplete. FEDORA-2025-fa6b4108c4 (python-argcomplete-3.6.2-2.fc43) has been submitted as an update to Fedora 43. https://bodhi.fedoraproject.org/updates/FEDORA-2025-fa6b4108c4 Can you please also push the fix to stable branches (f40+) ? Working on it. FEDORA-2025-8edf59c712 (python-argcomplete-3.6.2-2.fc41) has been submitted as an update to Fedora 41. https://bodhi.fedoraproject.org/updates/FEDORA-2025-8edf59c712 FEDORA-2025-1cb3645cc2 (python-argcomplete-3.6.2-2.fc40) has been submitted as an update to Fedora 40. https://bodhi.fedoraproject.org/updates/FEDORA-2025-1cb3645cc2 (In reply to Miro Hrončok from comment #12) > Working on it. Thanks a lot for handling this bug and related updates Thanks for the report and for finding the cause. FEDORA-2025-fa6b4108c4 (python-argcomplete-3.6.2-2.fc43) has been pushed to the Fedora 43 stable repository. If problem still persists, please make note of it in this bug report. FEDORA-2025-1516194d78 has been pushed to the Fedora 42 testing repository. Soon you'll be able to install the update with the following command: `sudo dnf upgrade --enablerepo=updates-testing --refresh --advisory=FEDORA-2025-1516194d78` You can provide feedback for this update here: https://bodhi.fedoraproject.org/updates/FEDORA-2025-1516194d78 See also https://fedoraproject.org/wiki/QA:Updates_Testing for more information on how to test updates. FEDORA-2025-8edf59c712 has been pushed to the Fedora 41 testing repository. Soon you'll be able to install the update with the following command: `sudo dnf upgrade --enablerepo=updates-testing --refresh --advisory=FEDORA-2025-8edf59c712` You can provide feedback for this update here: https://bodhi.fedoraproject.org/updates/FEDORA-2025-8edf59c712 See also https://fedoraproject.org/wiki/QA:Updates_Testing for more information on how to test updates. FEDORA-2025-1cb3645cc2 has been pushed to the Fedora 40 testing repository. Soon you'll be able to install the update with the following command: `sudo dnf upgrade --enablerepo=updates-testing --refresh --advisory=FEDORA-2025-1cb3645cc2` You can provide feedback for this update here: https://bodhi.fedoraproject.org/updates/FEDORA-2025-1cb3645cc2 See also https://fedoraproject.org/wiki/QA:Updates_Testing for more information on how to test updates. FEDORA-2025-1516194d78 (python-argcomplete-3.6.2-2.fc42) has been pushed to the Fedora 42 stable repository. If problem still persists, please make note of it in this bug report. FEDORA-2025-8edf59c712 (python-argcomplete-3.6.2-2.fc41) has been pushed to the Fedora 41 stable repository. If problem still persists, please make note of it in this bug report. FEDORA-2025-1cb3645cc2 (python-argcomplete-3.6.2-2.fc40) has been pushed to the Fedora 40 stable repository. If problem still persists, please make note of it in this bug report. |