[Bug 745767] Re: python tab-completion error: bash: COMP_WORDS: bad array subscript

Peter Cordes peter at cordes.ca
Sat Nov 29 12:46:33 UTC 2014


** Changed in: bash-completion (Ubuntu)
       Status: New => Fix Released

-- 
You received this bug notification because you are a member of Ubuntu
Foundations Bugs, which is subscribed to bash-completion in Ubuntu.
https://bugs.launchpad.net/bugs/745767

Title:
  python tab-completion error: bash: COMP_WORDS: bad array subscript

Status in bash-completion package in Ubuntu:
  Fix Released

Bug description:
  Binary package hint: bash-completion

  When I'm specifying the full path to a Python interpreter (which is
  very common for Python developers who use zc.buildout or virtualenv),
  attempting tab-completion of the first argument results in errors.

  To reproduce:
    1. touch python script.py
    2. chmod +x python
    3. type ./python scri<tab>

  Expected output:
    ./python script.py

  Actual output:
    ./python scribash: COMP_WORDS: bad array subscript
    pt.py

  The bug is in /etc/bash_completion.d/python, line 26.  If I replace

          [[ ${COMP_WORDS[COMP_CWORD-2]} != -@(Q|W) ]] && _filedir

  with

          [[ $COMP_CWORD -ge 2 ]] && [[ ${COMP_WORDS[COMP_CWORD-2]} !=
  -@(Q|W) ]] && _filedir

  then completion works without emitting spurious errors.

  ProblemType: Bug
  DistroRelease: Ubuntu 10.10
  Package: bash-completion 1:1.2-2ubuntu1.1
  ProcVersionSignature: Ubuntu 2.6.35-28.50-generic 2.6.35.11
  Uname: Linux 2.6.35-28-generic i686
  Architecture: i386
  Date: Wed Mar 30 17:55:42 2011
  EcryptfsInUse: Yes
  InstallationMedia: Ubuntu 9.10 "Karmic Koala" - Release i386 (20091028.5)
  PackageArchitecture: all
  ProcEnviron:
   LANGUAGE=lt_LT:lt:en_GB:en
   LC_CTYPE=lt_LT.UTF-8
   PATH=(custom, user)
   LANG=lt_LT.utf8
   SHELL=/bin/bash
  SourcePackage: bash-completion

To manage notifications about this bug go to:
https://bugs.launchpad.net/ubuntu/+source/bash-completion/+bug/745767/+subscriptions



More information about the foundations-bugs mailing list