Bug 1689507

Summary: [abrt] python3-argcomplete: find(): _check_module.py:26:find:AttributeError: 'NoneType' object has no attribute 'has_location'
Product: [Fedora] Fedora Reporter: Samuel <samuelnhuis>
Component: python-argcompleteAssignee: Miro Hrončok <mhroncok>
Status: CLOSED ERRATA QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: 30CC: dbmacartney, gspurgeon, igor.raits, mhroncok, plroskin, python-sig, steve.traylen
Target Milestone: ---   
Target Release: ---   
Hardware: x86_64   
OS: Unspecified   
URL: https://retrace.fedoraproject.org/faf/reports/bthash/ffa407e1426f603e11cd5f1bac53a3abf7c33879
Whiteboard: abrt_hash:ebfc98b1a9adbdf3ec779b7ac1a004c3fc2812ff;VARIANT_ID=workstation;
Fixed In Version: python-argcomplete-1.9.5-1.fc30 python-argcomplete-1.9.5-1.fc29 Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2019-04-13 00:05:21 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:
Bug Depends On: 1695149    
Bug Blocks:    
Attachments:
Description Flags
File: backtrace
none
File: cgroup
none
File: cpuinfo
none
File: environ
none
File: mountinfo
none
File: namespaces
none
File: open_fds none

Description Samuel 2019-03-16 09:41:23 UTC
Version-Release number of selected component:
python3-argcomplete-1.9.4-2.fc30

Additional info:
reporter:       libreport-2.10.0
cmdline:        python3.7 -m argcomplete._check_module ''
crash_function: find
exception_type: AttributeError
executable:     /usr/lib/python3.7/site-packages/argcomplete/_check_module.py
interpreter:    python3-3.7.2-7.fc30.x86_64
kernel:         5.0.0-300.fc30.x86_64
runlevel:       N 5
type:           Python3
uid:            1000

Truncated backtrace:
_check_module.py:26:find:AttributeError: 'NoneType' object has no attribute 'has_location'

Traceback (most recent call last):
  File "/usr/lib64/python3.7/runpy.py", line 193, in _run_module_as_main
    "__main__", mod_spec)
  File "/usr/lib64/python3.7/runpy.py", line 85, in _run_code
    exec(code, run_globals)
  File "/usr/lib/python3.7/site-packages/argcomplete/_check_module.py", line 49, in <module>
    main()
  File "/usr/lib/python3.7/site-packages/argcomplete/_check_module.py", line 42, in main
    with open(find(sys.argv[1])) as f:
  File "/usr/lib/python3.7/site-packages/argcomplete/_check_module.py", line 26, in find
    if not spec.has_location:
AttributeError: 'NoneType' object has no attribute 'has_location'

Local variables in innermost frame:
name: ''
names: ['']
spec: None

Potential duplicate: bug 1601763

Comment 1 Samuel 2019-03-16 09:41:26 UTC
Created attachment 1544722 [details]
File: backtrace

Comment 2 Samuel 2019-03-16 09:41:28 UTC
Created attachment 1544723 [details]
File: cgroup

Comment 3 Samuel 2019-03-16 09:41:29 UTC
Created attachment 1544724 [details]
File: cpuinfo

Comment 4 Samuel 2019-03-16 09:41:30 UTC
Created attachment 1544725 [details]
File: environ

Comment 5 Samuel 2019-03-16 09:41:32 UTC
Created attachment 1544726 [details]
File: mountinfo

Comment 6 Samuel 2019-03-16 09:41:33 UTC
Created attachment 1544727 [details]
File: namespaces

Comment 7 Samuel 2019-03-16 09:41:34 UTC
Created attachment 1544728 [details]
File: open_fds

Comment 8 Miro Hrončok 2019-03-16 12:17:57 UTC
How to reproduce this? Do you actually run the "python3.7 -m argcomplete._check_module ''" command? What is supposed to happen?

Comment 9 Miro Hrončok 2019-03-16 12:27:24 UTC
I've started this upstream yet until I know when this actually happens, I don't know what the proper fix is:

https://github.com/kislyuk/argcomplete/pull/261

Comment 10 Samuel 2019-03-17 04:54:51 UTC
(In reply to Miro Hrončok from comment #8)
> How to reproduce this? Do you actually run the "python3.7 -m
> argcomplete._check_module ''" command? What is supposed to happen?

Hi, sorry for the initial lack of information and context. I've only just been able to reproduce this.

From a bash terminal session, I have typed 'python3.7 -m ' and then hit the tab key twice. From here gnome-abrt notifies me that "python-argcomplete quit unexpectedly". 
I can mostly reproduce this by error by entering 'python3.7 -m ' which results in the help dialogue output, then retyping 'python3.7 -m ' and pressing the tab key twice.

Comment 11 Samuel 2019-03-17 05:12:00 UTC
Additionally, when typing 'python3.7 -m ' in a bash shell and pressing the tab key twice, it outputs the entire contents of the working directory. I am admittedly very inexperienced with python but my assumption is that modules should be listed rather than the entire contents of the working directory.

Comment 12 Miro Hrončok 2019-03-26 23:37:01 UTC
*** Bug 1692895 has been marked as a duplicate of this bug. ***

Comment 13 Miro Hrončok 2019-03-26 23:41:12 UTC
Samuel, thanks for the input. I'm working with argcomplete upstream to change the code not to raise the ABRT reports - those are actually false positives.

Comment 14 Fedora Update System 2019-04-10 12:33:12 UTC
python-argcomplete-1.9.5-1.fc30 has been submitted as an update to Fedora 30. https://bodhi.fedoraproject.org/updates/FEDORA-2019-22fbf54bf8

Comment 15 Fedora Update System 2019-04-10 12:33:41 UTC
python-argcomplete-1.9.5-1.fc29 has been submitted as an update to Fedora 29. https://bodhi.fedoraproject.org/updates/FEDORA-2019-2dadb71ee7

Comment 16 Fedora Update System 2019-04-12 02:47:10 UTC
python-argcomplete-1.9.5-1.fc30 has been pushed to the Fedora 30 testing repository. If problems still persist, please make note of it in this bug report.
See https://fedoraproject.org/wiki/QA:Updates_Testing for
instructions on how to install test updates.
You can provide feedback for this update here: https://bodhi.fedoraproject.org/updates/FEDORA-2019-22fbf54bf8

Comment 17 Fedora Update System 2019-04-12 03:55:56 UTC
python-argcomplete-1.9.5-1.fc29 has been pushed to the Fedora 29 testing repository. If problems still persist, please make note of it in this bug report.
See https://fedoraproject.org/wiki/QA:Updates_Testing for
instructions on how to install test updates.
You can provide feedback for this update here: https://bodhi.fedoraproject.org/updates/FEDORA-2019-2dadb71ee7

Comment 18 Fedora Update System 2019-04-13 00:05:21 UTC
python-argcomplete-1.9.5-1.fc30 has been pushed to the Fedora 30 stable repository. If problems still persist, please make note of it in this bug report.

Comment 19 Fedora Update System 2019-04-19 19:09:31 UTC
python-argcomplete-1.9.5-1.fc29 has been pushed to the Fedora 29 stable repository. If problems still persist, please make note of it in this bug report.