xontrib-argcomplete icon indicating copy to clipboard operation
xontrib-argcomplete copied to clipboard

Importing 'pathlib' in a script disabled autocompletion

Open brechtm opened this issue 4 years ago • 2 comments

For some reason xontrib-argcomplete wasn't working for my script. I've finally been able to identify that importing pathlib in my script somehow prevents tab completion from working! I have not yet investigated what the root cause is for this, however.

brechtm avatar Jun 21 '21 16:06 brechtm

hi! Could you please add the minimal example to repeat the issue?

anki-code avatar Jun 22 '21 18:06 anki-code

To reproduce this, just add "import pathlib" to one of the proto scripts in the xontrib-argcomplete/tests directory. But do note that the issue seems to depend on the version of Python (3.69) and/or argcomplete (1.8.1). I couldn't reproduce this on Python 3.9.5 with argcomplete 1.12.3. Is there a check that the argcomplete versions used by the script and the one by xontrib-argcomplete are compatible?

Running my script (proprietary, can't share) on Python 3.9.2 with argcomplete 1.12.3, completion suggestions are shown, but they include the help string shown after the arguments as well as other text output by <script> --help. But now, on another attempt in a fresh shell, again I don't get any completion suggestions.

Unfortunately, this is proving very difficult to debug and I can't spend more time on this...

brechtm avatar Jun 23 '21 11:06 brechtm