Repository: nvbn/thefuck (Python)

Issue:
Crash when trying to correct `pip un+install thefuck`
The output of `thefuck --version` (something like `The Fuck 3.1 using Python
3.5.0 and Bash 4.4.12(1)-release`):

    The Fuck 3.15 using Python 3.7.6

Your system (Debian 7, ArchLinux, Windows, etc.):

    Fedora 31

How to reproduce the bug:

    1. `pip un+install thefuck`
    2. `fuck`


The output of The Fuck with `THEFUCK_DEBUG=true` exported (typically execute `export THEFUCK_DEBUG=true` in your shell before The Fuck):

    Nothing

Anything else you think is relevant:

    Stacktrace:
```
➜  ~ fuck                    
DEBUG: Run with settings: {'alter_history': True,
 'debug': True,
 'env': {'GIT_TRACE': '1', 'LANG': 'C', 'LC_ALL': 'C'},
 'exclude_rules': [],
 'history_limit': None,
 'no_colors': False,
 'priority': {},
 'require_confirmation': True,
 'rules': [<const: All rules enabled>],
 'slow_commands': ['lein', 'react-native', 'gradle', './gradlew', 'vagrant'],
 'user_dir': PosixPath('/home/bjoern/.config/thefuck'),
 'wait_command': 3,
 'wait_slow_command': 15}
DEBUG: Received stdout: 
DEBUG: Received stderr: ERROR: unknown command "un+install" - maybe you meant "uninstall"

DEBUG: Call: pip un+install thefuck; with env: {'MODULEPATH': '/etc/scl/modulefiles:/etc/scl/modulefiles:/etc/scl/modulefiles:/usr/share/Modules/modulefiles:/etc/modulefiles:/usr/share/modulefiles', 'MODULESHOME': '/usr/share/Modules', 'SESSION_MANAGER': 'local/unix:@/tmp/.ICE-unix/89353,unix/unix:/tmp/.ICE-unix/89353', 'LANG': 'C', 'MODULES_RUN_QUARANTINE': 'LD_LIBRARY_PATH', 'XDG_CURRENT_DESKTOP': 'GNOME', 'HOME': '/home/bjoern', 'SSH_AUTH_SOCK': '/run/user/1000/keyring/ssh', 'WAYLAND_DISPLAY': 'wayland-0', 'GIO_LAUNCHED_DESKTOP_FILE_PID': '114880', 'INVOCATION_ID': '2e365a8005b343578188da653fa4abc2', 'LESSOPEN': '||/usr/bin/lesspipe.sh %s', 'QT_IM_MODULE': 'ibus', 'DESKTOP_SESSION': 'gnome', 'HOSTNAME': 'xps-9370', 'OLDPWD': '/home/bjoern', 'HISTSIZE': '50000', 'KDEDIRS': '/usr', 'USER': 'bjoern', 'TILIX_ID': '31ecbf37-ed53-42d7-ad81-478e7e6782ae', 'XDG_MENU_PREFIX': 'gnome-', 'DBUS_SESSION_BUS_ADDRESS': 'unix:path=/run/user/1000/bus', 'MANPATH': ':', 'LC_NUMERIC': 'de_DE.UTF-8', 'XDG_DATA_DIRS': '/home/bjoern/.local/share/flatpak/exports/share/:/var/lib/flatpak/exports/share/:/usr/local/share/:/usr/share/:/var/lib/snapd/desktop', 'MODULES_CMD': '/usr/share/Modules/libexec/modulecmd.tcl', 'VTE_VERSION': '5803', 'XDG_SESSION_DESKTOP': 'gnome', 'JOURNAL_STREAM': '9:1201623', 'LC_MEASUREMENT': 'de_DE.UTF-8', 'MANAGERPID': '1493', 'LC_TIME': 'de_DE.UTF-8', 'MAIL': '/var/spool/mail/bjoern', 'LOGNAME': 'bjoern', 'LC_PAPER': 'de_DE.UTF-8', 'PATH': '/usr/share/Modules/bin:/usr/local/bin:/usr/local/sbin:/usr/bin:/usr/sbin:/home/bjoern/bin:/var/lib/snapd/snap/bin:/home/bjoern/.local/bin:/home/bjoern/.npm-global/bin:/home/bjoern/.cargo/bin', 'XDG_RUNTIME_DIR': '/run/user/1000', 'XMODIFIERS': '@im=ibus', 'SHELL': '/usr/bin/zsh', 'XDG_SESSION_TYPE': 'wayland', 'FPATH': '/home/bjoern/.oh-my-zsh/custom/plugins/zsh-completions:/home/bjoern/.oh-my-zsh/custom/plugins/zsh-autosuggestions:/home/bjoern/.oh-my-zsh/plugins/sudo:/home/bjoern/.oh-my-zsh/plugins/npm:/home/bjoern/.oh-my-zsh/plugins/history:/home/bjoern/.oh-my-zsh/plugins/common-aliases:/home/bjoern/.oh-my-zsh/plugins/colorize:/home/bjoern/.oh-my-zsh/plugins/colored-man-pages:/home/bjoern/.oh-my-zsh/plugins/dnf:/home/bjoern/.oh-my-zsh/plugins/git:/home/bjoern/.oh-my-zsh/functions:/home/bjoern/.oh-my-zsh/completions:/usr/share/Modules/init/zsh-functions:/usr/local/share/zsh/site-functions:/usr/share/zsh/site-functions:/usr/share/zsh/5.7.1/functions:/home/bjoern/.oh-my-zsh/custom/plugins/zsh-completions/src', 'LC_MONETARY': 'de_DE.UTF-8', 'LOADEDMODULES': '', 'HISTCONTROL': 'ignoredups', 'USERNAME': 'bjoern', 'GDM_LANG': 'en_US.UTF-8', 'PWD': '/home/bjoern', 'SHLVL': '1', 'XAUTHORITY': '/run/user/1000/.mutter-Xwaylandauth.8999F0', 'COLORTERM': 'truecolor', 'MODULEPATH_modshare': '/usr/share/modulefiles:1:/usr/share/Modules/modulefiles:1:/etc/modulefiles:1', 'DISPLAY': ':0', 'GDMSESSION': 'gnome', 'XDG_SESSION_CLASS': 'user', 'TERM': 'xterm-256color', 'LS_COLORS': 'rs=0:di=38;5;33:ln=38;5;51:mh=00:pi=40;38;5;11:so=38;5;13:do=38;5;5:bd=48;5;232;38;5;11:cd=48;5;232;38;5;3:or=48;5;232;38;5;9:mi=01;37;41:su=48;5;196;38;5;15:sg=48;5;11;38;5;16:ca=48;5;196;38;5;226:tw=48;5;10;38;5;16:ow=48;5;10;38;5;21:st=48;5;21;38;5;15:ex=38;5;40:*.tar=38;5;9:*.tgz=38;5;9:*.arc=38;5;9:*.arj=38;5;9:*.taz=38;5;9:*.lha=38;5;9:*.lz4=38;5;9:*.lzh=38;5;9:*.lzma=38;5;9:*.tlz=38;5;9:*.txz=38;5;9:*.tzo=38;5;9:*.t7z=38;5;9:*.zip=38;5;9:*.z=38;5;9:*.dz=38;5;9:*.gz=38;5;9:*.lrz=38;5;9:*.lz=38;5;9:*.lzo=38;5;9:*.xz=38;5;9:*.zst=38;5;9:*.tzst=38;5;9:*.bz2=38;5;9:*.bz=38;5;9:*.tbz=38;5;9:*.tbz2=38;5;9:*.tz=38;5;9:*.deb=38;5;9:*.rpm=38;5;9:*.jar=38;5;9:*.war=38;5;9:*.ear=38;5;9:*.sar=38;5;9:*.rar=38;5;9:*.alz=38;5;9:*.ace=38;5;9:*.zoo=38;5;9:*.cpio=38;5;9:*.7z=38;5;9:*.rz=38;5;9:*.cab=38;5;9:*.wim=38;5;9:*.swm=38;5;9:*.dwm=38;5;9:*.esd=38;5;9:*.jpg=38;5;13:*.jpeg=38;5;13:*.mjpg=38;5;13:*.mjpeg=38;5;13:*.gif=38;5;13:*.bmp=38;5;13:*.pbm=38;5;13:*.pgm=38;5;13:*.ppm=38;5;13:*.tga=38;5;13:*.xbm=38;5;13:*.xpm=38;5;13:*.tif=38;5;13:*.tiff=38;5;13:*.png=38;5;13:*.svg=38;5;13:*.svgz=38;5;13:*.mng=38;5;13:*.pcx=38;5;13:*.mov=38;5;13:*.mpg=38;5;13:*.mpeg=38;5;13:*.m2v=38;5;13:*.mkv=38;5;13:*.webm=38;5;13:*.ogm=38;5;13:*.mp4=38;5;13:*.m4v=38;5;13:*.mp4v=38;5;13:*.vob=38;5;13:*.qt=38;5;13:*.nuv=38;5;13:*.wmv=38;5;13:*.asf=38;5;13:*.rm=38;5;13:*.rmvb=38;5;13:*.flc=38;5;13:*.avi=38;5;13:*.fli=38;5;13:*.flv=38;5;13:*.gl=38;5;13:*.dl=38;5;13:*.xcf=38;5;13:*.xwd=38;5;13:*.yuv=38;5;13:*.cgm=38;5;13:*.emf=38;5;13:*.ogv=38;5;13:*.ogx=38;5;13:*.aac=38;5;45:*.au=38;5;45:*.flac=38;5;45:*.m4a=38;5;45:*.mid=38;5;45:*.midi=38;5;45:*.mka=38;5;45:*.mp3=38;5;45:*.mpc=38;5;45:*.ogg=38;5;45:*.ra=38;5;45:*.wav=38;5;45:*.oga=38;5;45:*.opus=38;5;45:*.spx=38;5;45:*.xspf=38;5;45:', 'ZSH': '/home/bjoern/.oh-my-zsh', 'PAGER': 'less', 'LESS': '-R', 'LSCOLORS': 'Gxfxcxdxbxegedabagacad', 'NVM_DIR': '/home/bjoern/.nvm', 'THEFUCK_DEBUG': 'true', 'TF_ALIAS': 'fuck', 'PYTHONIOENCODING': 'utf-8', 'TF_SHELL_ALIASES': '-=\'cd -\'\n...=../..\n....=../../..\n.....=../../../..\n......=../../../../..\n1=\'cd -\'\n2=\'cd -2\'\n3=\'cd -3\'\n4=\'cd -4\'\n5=\'cd -5\'\n6=\'cd -6\'\n7=\'cd -7\'\n8=\'cd -8\'\n9=\'cd -9\'\nCA=\'2>&1 | cat -A\'\nG=\'| grep\'\nH=\'| head\'\nL=\'| less\'\nLL=\'2>&1 | less\'\nM=\'| most\'\nNE=\'2> /dev/null\'\nNUL=\'> /dev/null 2>&1\'\nP=\'2>&1| pygmentize -l pytb\'\nT=\'| tail\'\n_=\'sudo \'\nafind=\'ack -il\'\nccat=colorize_cat\ncless=colorize_less\ncp=\'cp -i\'\ndnfc=\'sudo dnf clean all\'\ndnfgi=\'sudo dnf groupinstall\'\ndnfgl=\'dnf grouplist\'\ndnfgr=\'sudo dnf groupremove\'\ndnfi=\'sudo dnf install\'\ndnfl=\'dnf list\'\ndnfli=\'dnf list installed\'\ndnfmc=\'dnf makecache\'\ndnfp=\'dnf info\'\ndnfr=\'sudo dnf remove\'\ndnfs=\'dnf search\'\ndnfu=\'sudo dnf upgrade\'\ndud=\'du -d 1 -h\'\nduf=\'du -sh *\'\nebuild=\'nocorrect ebuild\'\negrep=\'egrep --color=auto\'\nfd=\'find . -type d -name\'\nff=\'find . -type f -name\'\nfgrep=\'fgrep --color=auto\'\nfuck=\'TF_CMD=$(TF_ALIAS=fuck PYTHONIOENCODING=utf-8 TF_SHELL_ALIASES=$(alias) thefuck $(fc -ln -1 | tail -n 1)) && eval $TF_CMD ; test -n "$TF_CMD" && print -s $TF_CMD\'\ng=git\nga=\'git add\'\ngaa=\'git add --all\'\ngap=\'git apply\'\ngapa=\'git add --patch\'\ngau=\'git add --update\'\ngav=\'git add --verbose\'\ngb=\'git branch\'\ngbD=\'git branch -D\'\ngba=\'git branch -a\'\ngbd=\'git branch -d\'\ngbda=\'git branch --no-color --merged | command grep -vE "^(\\+|\\*|\\s*(master|develop|dev)\\s*$)" | command xargs -n 1 git branch -d\'\ngbl=\'git blame -b -w\'\ngbnm=\'git branch --no-merged\'\ngbr=\'git branch --remote\'\ngbs=\'git bisect\'\ngbsb=\'git bisect bad\'\ngbsg=\'git bisect good\'\ngbsr=\'git bisect reset\'\ngbss=\'git bisect start\'\ngc=\'git commit -v\'\n\'gc!\'=\'git commit -v --amend\'\ngca=\'git commit -v -a\'\n\'gca!\'=\'git commit -v -a --amend\'\ngcam=\'git commit -a -m\'\n\'gcan!\'=\'git commit -v -a --no-edit --amend\'\n\'gcans!\'=\'git commit -v -a -s --no-edit --amend\'\ngcb=\'git checkout -b\'\ngcd=\'git checkout develop\'\ngcf=\'git config --list\'\ngcl=\'git clone --recurse-submodules\'\ngclean=\'git clean -id\'\ngcm=\'git checkout master\'\ngcmsg=\'git commit -m\'\n\'gcn!\'=\'git commit -v --no-edit --amend\'\ngco=\'git checkout\'\ngcount=\'git shortlog -sn\'\ngcp=\'git cherry-pick\'\ngcpa=\'git cherry-pick --abort\'\ngcpc=\'git cherry-pick --continue\'\ngcs=\'git commit -S\'\ngcsm=\'git commit -s -m\'\ngd=\'git diff\'\ngdca=\'git diff --cached\'\ngdct=\'git describe --tags $(git rev-list --tags --max-count=1)\'\ngdcw=\'git diff --cached --word-diff\'\ngds=\'git diff --staged\'\ngdt=\'git diff-tree --no-commit-id --name-only -r\'\ngdw=\'git diff --word-diff\'\ngf=\'git fetch\'\ngfa=\'git fetch --all --prune\'\ngfg=\'git ls-files | grep\'\ngfo=\'git fetch origin\'\ngg=\'git gui citool\'\ngga=\'git gui citool --amend\'\nggpull=\'git pull origin "$(git_current_branch)"\'\nggpur=ggu\nggpush=\'git push origin "$(git_current_branch)"\'\nggsup=\'git branch --set-upstream-to=origin/$(git_current_branch)\'\nghh=\'git help\'\ngignore=\'git update-index --assume-unchanged\'\ngignored=\'git ls-files -v | grep "^[[:lower:]]"\'\ngist=\'nocorrect gist\'\ngit-svn-dcommit-push=\'git svn dcommit && git push github master:svntrunk\'\ngk=\'\\gitk --all --branches\'\ngke=\'\\gitk --all $(git log -g --pretty=%h)\'\ngl=\'git pull\'\nglg=\'git log --stat\'\nglgg=\'git log --graph\'\nglgga=\'git log --graph --decorate --all\'\nglgm=\'git log --graph --max-count=10\'\nglgp=\'git log --stat -p\'\nglo=\'git log --oneline --decorate\'\ngloburl=\'noglob urlglobber \'\nglod=\'git log --graph --pretty=\'\\\'\'%Cred%h%Creset -%C(auto)%d%Creset %s %Cgreen(%ad) %C(bold blue)<%an>%Creset\'\\\'\nglods=\'git log --graph --pretty=\'\\\'\'%Cred%h%Creset -%C(auto)%d%Creset %s %Cgreen(%ad) %C(bold blue)<%an>%Creset\'\\\'\' --date=short\'\nglog=\'git log --oneline --decorate --graph\'\ngloga=\'git log --oneline --decorate --graph --all\'\nglol=\'git log --graph --pretty=\'\\\'\'%Cred%h%Creset -%C(auto)%d%Creset %s %Cgreen(%cr) %C(bold blue)<%an>%Creset\'\\\'\nglola=\'git log --graph --pretty=\'\\\'\'%Cred%h%Creset -%C(auto)%d%Creset %s %Cgreen(%cr) %C(bold blue)<%an>%Creset\'\\\'\' --all\'\nglols=\'git log --graph --pretty=\'\\\'\'%Cred%h%Creset -%C(auto)%d%Creset %s %Cgreen(%cr) %C(bold blue)<%an>%Creset\'\\\'\' --stat\'\nglp=_git_log_prettily\nglum=\'git pull upstream master\'\ngm=\'git merge\'\ngma=\'git merge --abort\'\ngmom=\'git merge origin/master\'\ngmt=\'git mergetool --no-prompt\'\ngmtvim=\'git mergetool --no-prompt --tool=vimdiff\'\ngmum=\'git merge upstream/master\'\ngp=\'git push\'\ngpd=\'git push --dry-run\'\ngpf=\'git push --force-with-lease\'\n\'gpf!\'=\'git push --force\'\ngpoat=\'git push origin --all && git push origin --tags\'\ngpristine=\'git reset --hard && git clean -dfx\'\ngpsup=\'git push --set-upstream origin $(git_current_branch)\'\ngpu=\'git push upstream\'\ngpv=\'git push -v\'\ngr=\'git remote\'\ngra=\'git remote add\'\ngrb=\'git rebase\'\ngrba=\'git rebase --abort\'\ngrbc=\'git rebase --continue\'\ngrbd=\'git rebase develop\'\ngrbi=\'git rebase -i\'\ngrbm=\'git rebase master\'\ngrbs=\'git rebase --skip\'\ngrep=\'grep --color\'\ngrev=\'git revert\'\ngrh=\'git reset\'\ngrhh=\'git reset --hard\'\ngrm=\'git rm\'\ngrmc=\'git rm --cached\'\ngrmv=\'git remote rename\'\ngroh=\'git reset origin/$(git_current_branch) --hard\'\ngrrm=\'git remote remove\'\ngrs=\'git restore\'\ngrset=\'git remote set-url\'\ngrss=\'git restore --source\'\ngrt=\'cd "$(git rev-parse --show-toplevel || echo .)"\'\ngru=\'git reset --\'\ngrup=\'git remote update\'\ngrv=\'git remote -v\'\ngsb=\'git status -sb\'\ngsd=\'git svn dcommit\'\ngsh=\'git show\'\ngsi=\'git submodule init\'\ngsps=\'git show --pretty=short --show-signature\'\ngsr=\'git svn rebase\'\ngss=\'git status -s\'\ngst=\'git status\'\ngsta=\'git stash push\'\ngstaa=\'git stash apply\'\ngstall=\'git stash --all\'\ngstc=\'git stash clear\'\ngstd=\'git stash drop\'\ngstl=\'git stash list\'\ngstp=\'git stash pop\'\ngsts=\'git stash show --text\'\ngstu=\'git stash --include-untracked\'\ngsu=\'git submodule update\'\ngsw=\'git switch\'\ngswc=\'git switch -c\'\ngtl=\'gtl(){ git tag --sort=-v:refname -n -l "${1}*" }; noglob gtl\'\ngts=\'git tag -s\'\ngtv=\'git tag | sort -V\'\ngunignore=\'git update-index --no-assume-unchanged\'\ngunwip=\'git log -n 1 | grep -q -c "\\-\\-wip\\-\\-" && git reset HEAD~1\'\ngup=\'git pull --rebase\'\ngupa=\'git pull --rebase --autostash\'\ngupav=\'git pull --rebase --autostash -v\'\ngupv=\'git pull --rebase -v\'\ngwch=\'git whatchanged -p --abbrev-commit --pretty=medium\'\ngwip=\'git add -A; git rm $(git ls-files --deleted) 2> /dev/null; git commit --no-verify --no-gpg-sign -m "--wip-- [skip ci]"\'\nh=history\nhelp=man\nheroku=\'nocorrect heroku\'\nhgrep=\'fc -El 0 | grep\'\nhistory=omz_history\nhpodder=\'nocorrect hpodder\'\nhsi=\'hs -i\'\nl=\'ls -lFh\'\nl.=\'ls -d .* --color=auto\'\nlS=\'ls -1FSsh\'\nla=\'ls -lAFh\'\nlart=\'ls -1Fcart\'\nldot=\'ls -ld .*\'\nll=\'ls -l\'\nlr=\'ls -tRFh\'\nlrt=\'ls -1Fcrt\'\nls=\'ls --color=auto\'\nlsa=\'ls -lah\'\nlt=\'ls -ltFh\'\nman=\'nocorrect man\'\nmd=\'mkdir -p\'\nmkdir=\'nocorrect mkdir\'\nmv=\'mv -i\'\nmysql=\'nocorrect mysql\'\nnpmD=\'npm i -D \'\nnpmE=\'PATH="$(npm bin)":"$PATH"\'\nnpmI=\'npm init\'\nnpmL=\'npm list\'\nnpmL0=\'npm ls --depth=0\'\nnpmO=\'npm outdated\'\nnpmP=\'npm publish\'\nnpmR=\'npm run\'\nnpmS=\'npm i -S \'\nnpmV=\'npm -v\'\nnpmg=\'npm i -g \'\nnpmst=\'npm start\'\nnpmt=\'npm test\'\np=\'ps -f\'\nrd=rmdir\nrm=\'rm -i\'\nrun-help=man\nsgrep=\'grep -R -n -H -C 5 --exclude-dir={.git,.svn,CVS} \'\nsortnr=\'sort -n -r\'\nsudo=\'nocorrect sudo\'\nt=\'tail -f\'\nunexport=unset\nvi=vim\nwhich=\'(alias; declare -f) | /usr/bin/which --tty-only --read-alias --read-functions --show-tilde --show-dot\'\nwhich-command=whence\nxzegrep=\'xzegrep --color=auto\'\nxzfgrep=\'xzfgrep --color=auto\'\nxzgrep=\'xzgrep --color=auto\'\nzegrep=\'zegrep --color=auto\'\nzfgrep=\'zfgrep --color=auto\'\nzgrep=\'zgrep --color=auto\'\nzshrc=\'${=EDITOR} ~/.zshrc\'', '_': '/usr/bin/thefuck', 'LC_ALL': 'C', 'GIT_TRACE': '1'}; is slow:  took: 0:00:00.414857
DEBUG: Importing rule: ag_literal; took: 0:00:00.000625
DEBUG: Importing rule: apt_get; took: 0:00:00.000856
DEBUG: Importing rule: apt_get_search; took: 0:00:00.000356
DEBUG: Importing rule: apt_invalid_operation; took: 0:00:00.000911
DEBUG: Importing rule: aws_cli; took: 0:00:00.000347
DEBUG: Importing rule: brew_install; took: 0:00:00.000398
DEBUG: Importing rule: brew_link; took: 0:00:00.000349
DEBUG: Importing rule: brew_uninstall; took: 0:00:00.000427
DEBUG: Importing rule: brew_unknown_command; took: 0:00:00.000180
DEBUG: Importing rule: brew_update_formula; took: 0:00:00.000338
DEBUG: Importing rule: brew_upgrade; took: 0:00:00.000134
DEBUG: Importing rule: cargo; took: 0:00:00.000122
DEBUG: Importing rule: cargo_no_command; took: 0:00:00.000358
DEBUG: Importing rule: cd_correction; took: 0:00:00.001285
DEBUG: Importing rule: cd_mkdir; took: 0:00:00.000491
DEBUG: Importing rule: cd_parent; took: 0:00:00.000132
DEBUG: Importing rule: chmod_x; took: 0:00:00.000154
DEBUG: Importing rule: composer_not_command; took: 0:00:00.000442
DEBUG: Importing rule: cp_omitting_directory; took: 0:00:00.000714
DEBUG: Importing rule: cpp11; took: 0:00:00.000466
DEBUG: Importing rule: dirty_untar; took: 0:00:00.001937
DEBUG: Importing rule: dirty_unzip; took: 0:00:00.000467
DEBUG: Importing rule: django_south_ghost; took: 0:00:00.000165
DEBUG: Importing rule: django_south_merge; took: 0:00:00.000167
DEBUG: Importing rule: docker_not_command; took: 0:00:00.000748
DEBUG: Importing rule: dry; took: 0:00:00.000171
DEBUG: Importing rule: fab_command_not_found; took: 0:00:00.000936
DEBUG: Importing rule: fix_alt_space; took: 0:00:00.000755
DEBUG: Importing rule: fix_file; took: 0:00:00.004750
DEBUG: Importing rule: gem_unknown_command; took: 0:00:00.000664
DEBUG: Importing rule: git_add; took: 0:00:00.000848
DEBUG: Importing rule: git_add_force; took: 0:00:00.000457
DEBUG: Importing rule: git_bisect_usage; took: 0:00:00.000460
DEBUG: Importing rule: git_branch_delete; took: 0:00:00.000470
DEBUG: Importing rule: git_branch_exists; took: 0:00:00.000585
DEBUG: Importing rule: git_branch_list; took: 0:00:00.000483
DEBUG: Importing rule: git_checkout; took: 0:00:00.000481
DEBUG: Importing rule: git_diff_no_index; took: 0:00:00.000443
DEBUG: Importing rule: git_diff_staged; took: 0:00:00.000424
DEBUG: Importing rule: git_fix_stash; took: 0:00:00.000484
DEBUG: Importing rule: git_flag_after_filename; took: 0:00:00.000437
DEBUG: Importing rule: git_help_aliased; took: 0:00:00.000449
DEBUG: Importing rule: git_not_command; took: 0:00:00.000424
DEBUG: Importing rule: git_pull; took: 0:00:00.000346
DEBUG: Importing rule: git_pull_clone; took: 0:00:00.000539
DEBUG: Importing rule: git_pull_uncommitted_changes; took: 0:00:00.001125
DEBUG: Importing rule: git_push; took: 0:00:00.000944
DEBUG: Importing rule: git_push_force; took: 0:00:00.000756
DEBUG: Importing rule: git_push_pull; took: 0:00:00.000681
DEBUG: Importing rule: git_rebase_merge_dir; took: 0:00:00.000641
DEBUG: Importing rule: git_rebase_no_changes; took: 0:00:00.000328
DEBUG: Importing rule: git_remote_seturl_add; took: 0:00:00.000311
DEBUG: Importing rule: git_rm_local_modifications; took: 0:00:00.000438
DEBUG: Importing rule: git_rm_recursive; took: 0:00:00.000432
DEBUG: Importing rule: git_rm_staged; took: 0:00:00.000427
DEBUG: Importing rule: git_stash; took: 0:00:00.000441
DEBUG: Importing rule: git_stash_pop; took: 0:00:00.000446
DEBUG: Importing rule: git_tag_force; took: 0:00:00.000435
DEBUG: Importing rule: git_two_dashes; took: 0:00:00.000364
DEBUG: Importing rule: go_run; took: 0:00:00.000338
DEBUG: Importing rule: gradle_no_task; took: 0:00:00.000639
DEBUG: Importing rule: gradle_wrapper; took: 0:00:00.000325
DEBUG: Importing rule: grep_arguments_order; took: 0:00:00.000368
DEBUG: Importing rule: grep_recursive; took: 0:00:00.001079
DEBUG: Importing rule: grunt_task_not_found; took: 0:00:00.001706
DEBUG: Importing rule: gulp_not_task; took: 0:00:00.000338
DEBUG: Importing rule: has_exists_script; took: 0:00:00.000312
DEBUG: Importing rule: heroku_not_command; took: 0:00:00.000326
DEBUG: Importing rule: history; took: 0:00:00.000142
DEBUG: Importing rule: hostscli; took: 0:00:00.000495
DEBUG: Importing rule: ifconfig_device_not_found; took: 0:00:00.000405
DEBUG: Importing rule: java; took: 0:00:00.000453
DEBUG: Importing rule: javac; took: 0:00:00.000534
DEBUG: Importing rule: lein_not_task; took: 0:00:00.000776
DEBUG: Importing rule: ln_no_hard_link; took: 0:00:00.000385
DEBUG: Importing rule: ln_s_order; took: 0:00:00.000374
DEBUG: Importing rule: ls_all; took: 0:00:00.000388
DEBUG: Importing rule: ls_lah; took: 0:00:00.000334
DEBUG: Importing rule: man; took: 0:00:00.000341
DEBUG: Importing rule: man_no_space; took: 0:00:00.000130
DEBUG: Importing rule: mercurial; took: 0:00:00.000468
DEBUG: Importing rule: missing_space_before_subcommand; took: 0:00:00.000169
DEBUG: Importing rule: mkdir_p; took: 0:00:00.000329
DEBUG: Importing rule: mvn_no_command; took: 0:00:00.000332
DEBUG: Importing rule: mvn_unknown_lifecycle_phase; took: 0:00:00.000337
DEBUG: Importing rule: no_command; took: 0:00:00.000326
DEBUG: Importing rule: no_such_file; took: 0:00:00.000139
DEBUG: Importing rule: npm_missing_script; took: 0:00:00.000673
DEBUG: Importing rule: npm_run_script; took: 0:00:00.000322
DEBUG: Importing rule: npm_wrong_command; took: 0:00:00.000495
DEBUG: Importing rule: open; took: 0:00:00.000409
DEBUG: Importing rule: pacman; took: 0:00:00.000454
DEBUG: Importing rule: pacman_not_found; took: 0:00:00.000136
DEBUG: Importing rule: path_from_history; took: 0:00:00.000168
DEBUG: Importing rule: pip_unknown_command; took: 0:00:00.000430
DEBUG: Importing rule: port_already_in_use; took: 0:00:00.000220
DEBUG: Importing rule: python_command; took: 0:00:00.000315
DEBUG: Importing rule: python_execute; took: 0:00:00.000327
DEBUG: Importing rule: quotation_marks; took: 0:00:00.000126
DEBUG: Importing rule: react_native_command_unrecognized; took: 0:00:00.000335
DEBUG: Importing rule: remove_trailing_cedilla; took: 0:00:00.000124
DEBUG: Importing rule: rm_dir; took: 0:00:00.000373
DEBUG: Importing rule: rm_root; took: 0:00:00.000315
DEBUG: Importing rule: scm_correction; took: 0:00:00.000444
DEBUG: Importing rule: sed_unterminated_s; took: 0:00:00.000424
DEBUG: Importing rule: sl_ls; took: 0:00:00.000151
DEBUG: Importing rule: ssh_known_hosts; took: 0:00:00.000440
DEBUG: Importing rule: sudo; took: 0:00:00.000161
DEBUG: Importing rule: sudo_command_from_user_path; took: 0:00:00.000328
DEBUG: Importing rule: switch_lang; took: 0:00:00.000155
DEBUG: Importing rule: systemctl; took: 0:00:00.000517
DEBUG: Importing rule: test.py; took: 0:00:00.000118
DEBUG: Importing rule: tmux; took: 0:00:00.000352
DEBUG: Importing rule: touch; took: 0:00:00.000309
DEBUG: Importing rule: tsuru_login; took: 0:00:00.000343
DEBUG: Importing rule: tsuru_not_command; took: 0:00:00.000676
DEBUG: Importing rule: unknown_command; took: 0:00:00.000464
DEBUG: Importing rule: vagrant_up; took: 0:00:00.000787
DEBUG: Importing rule: whois; took: 0:00:00.001220
DEBUG: Importing rule: workon_doesnt_exists; took: 0:00:00.001056
DEBUG: Importing rule: yarn_alias; took: 0:00:00.000811
DEBUG: Importing rule: yarn_command_not_found; took: 0:00:00.000888
DEBUG: Importing rule: yarn_help; took: 0:00:00.000513
DEBUG: Trying rule: path_from_history; took: 0:00:00.000839
DEBUG: Trying rule: dry; took: 0:00:00.000097
DEBUG: Trying rule: git_stash_pop; took: 0:00:00.000035
DEBUG: Trying rule: test.py; took: 0:00:00.000003
DEBUG: Trying rule: ag_literal; took: 0:00:00.000024
DEBUG: Trying rule: aws_cli; took: 0:00:00.000020
DEBUG: Trying rule: brew_link; took: 0:00:00.000022
DEBUG: Trying rule: brew_uninstall; took: 0:00:00.000018
DEBUG: Trying rule: brew_update_formula; took: 0:00:00.000017
DEBUG: Trying rule: cargo; took: 0:00:00.000004
DEBUG: Trying rule: cargo_no_command; took: 0:00:00.000020
DEBUG: Trying rule: cd_correction; took: 0:00:00.000021
DEBUG: Trying rule: cd_mkdir; took: 0:00:00.000018
DEBUG: Trying rule: cd_parent; took: 0:00:00.000005
DEBUG: Trying rule: chmod_x; took: 0:00:00.000005
DEBUG: Trying rule: composer_not_command; took: 0:00:00.000019
DEBUG: Trying rule: cp_omitting_directory; took: 0:00:00.000019
DEBUG: Trying rule: cpp11; took: 0:00:00.000020
DEBUG: Trying rule: dirty_untar; took: 0:00:00.000029
DEBUG: Trying rule: dirty_unzip; took: 0:00:00.000027
DEBUG: Trying rule: django_south_ghost; took: 0:00:00.000003
DEBUG: Trying rule: django_south_merge; took: 0:00:00.000004
DEBUG: Trying rule: docker_not_command; took: 0:00:00.000020
DEBUG: Trying rule: fab_command_not_found; took: 0:00:00.000018
DEBUG: Trying rule: fix_alt_space; took: 0:00:00.000007
DEBUG: Trying rule: fix_file; took: 0:00:00.000019
DEBUG: Trying rule: gem_unknown_command; took: 0:00:00.000019
DEBUG: Trying rule: git_add; took: 0:00:00.000017
DEBUG: Trying rule: git_add_force; took: 0:00:00.000016
DEBUG: Trying rule: git_bisect_usage; took: 0:00:00.000015
DEBUG: Trying rule: git_branch_delete; took: 0:00:00.000015
DEBUG: Trying rule: git_branch_exists; took: 0:00:00.000014
DEBUG: Trying rule: git_branch_list; took: 0:00:00.000014
DEBUG: Trying rule: git_checkout; took: 0:00:00.000015
DEBUG: Trying rule: git_diff_no_index; took: 0:00:00.000017
DEBUG: Trying rule: git_diff_staged; took: 0:00:00.000014
DEBUG: Trying rule: git_fix_stash; took: 0:00:00.000014
DEBUG: Trying rule: git_flag_after_filename; took: 0:00:00.000014
DEBUG: Trying rule: git_help_aliased; took: 0:00:00.000014
DEBUG: Trying rule: git_not_command; took: 0:00:00.000014
DEBUG: Trying rule: git_pull; took: 0:00:00.000015
DEBUG: Trying rule: git_pull_clone; took: 0:00:00.000014
DEBUG: Trying rule: git_pull_uncommitted_changes; took: 0:00:00.000014
DEBUG: Trying rule: git_push; took: 0:00:00.000017
DEBUG: Trying rule: git_push_pull; took: 0:00:00.000014
DEBUG: Trying rule: git_rebase_merge_dir; took: 0:00:00.000020
DEBUG: Trying rule: git_rebase_no_changes; took: 0:00:00.000015
DEBUG: Trying rule: git_remote_seturl_add; took: 0:00:00.000015
DEBUG: Trying rule: git_rm_local_modifications; took: 0:00:00.000014
DEBUG: Trying rule: git_rm_recursive; took: 0:00:00.000014
DEBUG: Trying rule: git_rm_staged; took: 0:00:00.000014
DEBUG: Trying rule: git_stash; took: 0:00:00.000014
DEBUG: Trying rule: git_tag_force; took: 0:00:00.000017
DEBUG: Trying rule: git_two_dashes; took: 0:00:00.000014
DEBUG: Trying rule: go_run; took: 0:00:00.000017
DEBUG: Trying rule: gradle_no_task; took: 0:00:00.000018
DEBUG: Trying rule: gradle_wrapper; took: 0:00:00.000016
DEBUG: Trying rule: grep_arguments_order; took: 0:00:00.000018
DEBUG: Trying rule: grep_recursive; took: 0:00:00.000016
DEBUG: Trying rule: grunt_task_not_found; took: 0:00:00.000017
DEBUG: Trying rule: gulp_not_task; took: 0:00:00.000017
DEBUG: Trying rule: has_exists_script; took: 0:00:00.000027
DEBUG: Trying rule: heroku_not_command; took: 0:00:00.000019
DEBUG: Trying rule: hostscli; took: 0:00:00.000018
DEBUG: Trying rule: ifconfig_device_not_found; took: 0:00:00.000017
DEBUG: Trying rule: java; took: 0:00:00.000020
DEBUG: Trying rule: javac; took: 0:00:00.000017
DEBUG: Trying rule: lein_not_task; took: 0:00:00.000019
DEBUG: Trying rule: ln_no_hard_link; took: 0:00:00.000010
DEBUG: Trying rule: ln_s_order; took: 0:00:00.000006
DEBUG: Trying rule: ls_all; took: 0:00:00.000017
DEBUG: Trying rule: ls_lah; took: 0:00:00.000015
DEBUG: Trying rule: man; took: 0:00:00.000018
DEBUG: Trying rule: mercurial; took: 0:00:00.000017
DEBUG: Trying rule: missing_space_before_subcommand; took: 0:00:00.000089
DEBUG: Trying rule: mkdir_p; took: 0:00:00.000009
DEBUG: Trying rule: mvn_no_command; took: 0:00:00.000019
DEBUG: Trying rule: mvn_unknown_lifecycle_phase; took: 0:00:00.000016
DEBUG: Trying rule: no_such_file; took: 0:00:00.000699
DEBUG: Trying rule: npm_missing_script; took: 0:00:00.000023
DEBUG: Trying rule: npm_run_script; took: 0:00:00.000017
DEBUG: Trying rule: npm_wrong_command; took: 0:00:00.000019
DEBUG: Trying rule: open; took: 0:00:00.000020
DEBUG: Trying rule: pip_unknown_command; took: 0:00:00.000020
DEBUG: Total took: 0:00:00.493066
Traceback (most recent call last):
  File "/usr/bin/thefuck", line 11, in <module>
    load_entry_point('thefuck==3.15', 'console_scripts', 'thefuck')()
  File "/usr/lib/python3.7/site-packages/thefuck/main.py", line 67, in main
    fix_command()
  File "/usr/lib/python3.7/site-packages/thefuck/main.py", line 31, in fix_command
    selected_command = select_command(corrected_commands)
  File "/usr/lib/python3.7/site-packages/thefuck/ui.py", line 70, in select_command
    selector = CommandSelector(corrected_commands)
  File "/usr/lib/python3.7/site-packages/thefuck/ui.py", line 33, in __init__
    self._commands = [next(self._commands_gen)]
  File "/usr/lib/python3.7/site-packages/thefuck/corrector.py", line 43, in organize_commands
    first_command = next(corrected_commands)
  File "/usr/lib/python3.7/site-packages/thefuck/corrector.py", line 74, in <genexpr>
    for corrected in rule.get_corrected_commands(command))
  File "/usr/lib/python3.7/site-packages/thefuck/types.py", line 240, in get_corrected_commands
    new_commands = self.get_new_command(command)
  File "/usr/lib/python3.7/site-packages/thefuck/rules/pip_unknown_command.py", line 16, in get_new_command
    command.stderr)[0]
IndexError: list index out of range
```

<!-- It's only with enough information that we can do something to fix the problem. -->



Discussion:

Patch:
diff --git a/thefuck/rules/pip_unknown_command.py b/thefuck/rules/pip_unknown_command.py
index 75fcc7caa..2720cda5e 100644
--- a/thefuck/rules/pip_unknown_command.py
+++ b/thefuck/rules/pip_unknown_command.py
@@ -12,8 +12,8 @@ def match(command):
 
 
 def get_new_command(command):
-    broken_cmd = re.findall(r'ERROR: unknown command \"([a-z]+)\"',
+    broken_cmd = re.findall(r'ERROR: unknown command "([^"]+)"',
                             command.output)[0]
-    new_cmd = re.findall(r'maybe you meant \"([a-z]+)\"', command.output)[0]
+    new_cmd = re.findall(r'maybe you meant "([^"]+)"', command.output)[0]
 
     return replace_argument(command.script, broken_cmd, new_cmd)


Test patch:
diff --git a/tests/rules/test_pip_unknown_command.py b/tests/rules/test_pip_unknown_command.py
index 22abef269..36d23dafb 100644
--- a/tests/rules/test_pip_unknown_command.py
+++ b/tests/rules/test_pip_unknown_command.py
@@ -4,13 +4,23 @@
 
 
 @pytest.fixture
-def pip_unknown_cmd():
-    return '''ERROR: unknown command "instatl" - maybe you meant "install"'''
+def pip_unknown_cmd_without_recommend():
+    return '''ERROR: unknown command "i"'''
 
 
 @pytest.fixture
-def pip_unknown_cmd_without_recommend():
-    return '''ERROR: unknown command "i"'''
+def broken():
+    return 'instatl'
+
+
+@pytest.fixture
+def suggested():
+    return 'install'
+
+
+@pytest.fixture
+def pip_unknown_cmd(broken, suggested):
+    return 'ERROR: unknown command "{}" - maybe you meant "{}"'.format(broken, suggested)
 
 
 def test_match(pip_unknown_cmd, pip_unknown_cmd_without_recommend):
@@ -19,6 +29,9 @@ def test_match(pip_unknown_cmd, pip_unknown_cmd_without_recommend):
                              pip_unknown_cmd_without_recommend))
 
 
-def test_get_new_command(pip_unknown_cmd):
-    assert get_new_command(Command('pip instatl',
-                                   pip_unknown_cmd)) == 'pip install'
+@pytest.mark.parametrize('script, broken, suggested, new_cmd', [
+    ('pip un+install thefuck', 'un+install', 'uninstall', 'pip uninstall thefuck'),
+    ('pip instatl', 'instatl', 'install', 'pip install')])
+def test_get_new_command(script, new_cmd, pip_unknown_cmd):
+    assert get_new_command(Command(script,
+                                   pip_unknown_cmd)) == new_cmd