Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

pip autocompletion should silence of KeyboardInterrupts #3942

Closed
anntzer opened this issue Aug 31, 2016 · 2 comments · Fixed by #5924

Comments

@anntzer
Copy link
Contributor

@anntzer anntzer commented Aug 31, 2016

  • Pip version: 8.1.2
  • Python version: 3.5.2
  • Operating System: Arch Linux

Description:

pip uninstall <TAB> quickly followed by Ctrl-C causes a traceback (associated with the KeyboardInterrupt) to be printed. This traceback should arguably not be displayed.

A simple fix would be to change pip completion --zsh (and similarly --bash) to

# pip zsh completion start
function _pip_completion {
  local words cword
  read -Ac words
  read -cn cword
  reply=( $( COMP_WORDS="$words[*]" \
             COMP_CWORD=$(( cword-1 )) \
             PIP_AUTO_COMPLETE=1 $words[1] 2>/dev/null ) ) # note the redirection.
}
compctl -K _pip_completion pip
# pip zsh completion end
@DavidBord

This comment has been minimized.

Copy link
Contributor

@DavidBord DavidBord commented May 9, 2019

I didn't succeed in reproducing this issue with pip uninstall but I was able to interrupt pip freeze quite successfully

@cjerdonek

This comment has been minimized.

Copy link
Member

@cjerdonek cjerdonek commented May 9, 2019

Can you include the traceback in the issue so others can see what the problem is?

@lock lock bot added the S: auto-locked label Sep 6, 2019
@lock lock bot locked as resolved and limited conversation to collaborators Sep 6, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
4 participants
You can’t perform that action at this time.