Description of problem: Using tab completion in the shell for fedpkg commands crashes python3-argcomplete, and the crash collected by abrt (it refuses to process the crash though). These are the details that abrt collects: reason: pkg_resources.DistributionNotFound: The 'fedpkg==1.30' distribution was not found and is required by the application cmdline: /usr/bin/python3 -s /usr/bin/python-argcomplete-check-easy-install-script /usr/bin/fedpkg executable: /usr/bin/python-argcomplete-check-easy-install-script backtrace: pkg_resources.DistributionNotFound: The 'fedpkg==1.30' distribution was not found and is required by the application Traceback (most recent call last): pkg_resources.DistributionNotFound: The 'fedpkg==1.30' distribution was not found and is required by the application Local variables in innermost frame: requirers: None ws: <pkg_resources.WorkingSet object at 0x7f48dd771c18> dist: None req: Requirement.parse('fedpkg==1.30') required_by: defaultdict(<class 'set'>, {}) req_extras: {} to_activate: [] best: {'fedpkg': None} processed: {} extras: None replace_conflicting: False installer: None env: <pkg_resources.Environment object at 0x7f48e110db38> requirements: [] self: <pkg_resources.WorkingSet object at 0x7f48dd771c18> Version-Release number of selected component (if applicable): fedpkg-1.30-4.fc27.noarch python3-argcomplete-1.9.2-1.fc27 How reproducible: Every time the tab is pressed for completing fedpkg CLI. Steps to Reproduce: 1. Install fedpkg and python3-argcomplete 2. In a shell, type "fedpkg new-so" and press the tab key Actual results: Exception happens in the argcomplete code, and after a small delay, tab completion happens. Expected results: Tab completion happens without delay and without causing exceptions. Additional info: Since fedpkg doesn't depend on python3-argcomplete, and I don't find any references to argcomplete in the fedpkg source code, I am not sure what causes this error.
So far, there is no Python 3 package for fedpkg. It is only distributed in Python 2 package. I have no idea how python-argcomplete works, we also only provide bash and zsh autocomplete script.
I know, which is why I am baffled that installing a completely unrelated package suddenly produces these strange crashes when using fedpkg. As I said, I couldn't find any code that could cause this issue - I just thought that someone else might be smarter than me and find something.
Hi Fabio, what do you mean by "installing a completely unrelated package suddenly produces these strange crashes when using fedpkg."? Can you give the steps you did to reproduce this issue?
I mean this: fedpkg is installed, python3-argcomplete is not: everything works fine fedpkg is installed, python3-argcomplete is also installed: I get crashes during tab completion for fedpkg commands Since fedpkg is a python2 package, python3-argcomplete obviously is a python3 package, and fedpkg isn't even using the argcomplete package, I consider those 2 completely unrelated packages, where installing one causes crashes when using the other - which is why I find this to be a strange error. I don't even get error messages on the terminal when setting PYTHONWARNINGS, PYTHONDEBUG and PYTHONVERBOSE flags. Upon further investigation, it looks like this is an error in the way argcomplete looks for completions (with the python-argcomplete-check-easy-install-script script): It always fall back to trying to import the package, and since fedpkg is a python2 application it fails because it wants to import a python3 package named fedpkg. So, I'm reassigning this to the python-argcomplete package ... Thanks for your help.
Same here. Additionally, ABRT is unable to report it, saying the report data is invalid.
I cannot reproduce this in mock and on my system fedpkg is already python3 driven. Can you still reproduce this?
The script has: if line1.startswith('#') and ('py' in line1 or 'Py' in line1): We could patch it use: if line1.startswith('#') and ('/usr/bin/python3' in line1): And that should do it.
Correction, fedpkg doesn't have PYTHON_ARGCOMPLETE_OK any more.
It looks like I can't reproduce this issue anymore with the latest fedpkg and python-argcomplete packages from fedora 28/updates-testing. I think we can close this bug. I'll re-open it if it happens again. Thanks :)