anki-code / xontrib-argcomplete

Argcomplete support to tab completion of python and xonsh scripts in xonsh shell.
BSD 2-Clause "Simplified" License
27 stars 5 forks source link

TypeError: cannot unpack non-iterable when loaded #10

Closed Maxwellfire closed 3 months ago

Maxwellfire commented 3 months ago

I'm having issues with xonsh crashing when I try to tabcomplete sometimes. I've narrowed things down to this package

The error that I'm getting is:

Traceback (most recent call last):
  File "/opt/pipx/venvs/xonsh/lib/python3.10/site-packages/xonsh/procs/proxies.py", line 523, in run
    r = self.f(self.args, sp_stdin, sp_stdout, sp_stderr, spec, spec.stack)
  File "/opt/pipx/venvs/xonsh/lib/python3.10/site-packages/xonsh/procs/proxies.py", line 319, in proxy_five
    return f(args, stdin, stdout, stderr, spec)
  File "/opt/pipx/venvs/xonsh/lib/python3.10/site-packages/xonsh/xoreutils/which.py", line 165, in which
    for abs_name, from_where in matches:
TypeError: cannot unpack non-iterable NoneType object

Steps to reproduce:

  1. Load xonsh with no rc file so that everything is default using xonsh --rc ''
  2. load the argcomplete package using xontrib load argcomplete
  3. Type aa<tab> and see the error

Packages:

My package versions are:

package xonsh 0.16.0, installed using Python 3.10.12
    - xonsh
    - xonsh-cat
    - xonsh-uname
    - xonsh-uptime
    Injected Packages:
      - pyperclip 1.8.2
      - xonsh 0.16.0
      - xonsh-apt-tabcomplete 0.1.6
      - xontrib-argcomplete 0.3.2
      - xontrib-sh 0.3.1
      - xontrib-vox 0.0.1
anki-code commented 3 months ago

Hi! I can't reproduce this.

cd /tmp
xonsh --no-rc
xontrib load argcomplete
aa<Tab>
# As expected.
anki-code commented 3 months ago

But I traced the issue and I'm going to fix it in xonsh repo.