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

KeyError: 'packages' was thrown in shell complettion #5214

Closed
dqkqd opened this issue Jul 31, 2022 · 5 comments
Closed

KeyError: 'packages' was thrown in shell complettion #5214

dqkqd opened this issue Jul 31, 2022 · 5 comments
Labels
Type: Bug 🐛 This issue is a bug.

Comments

@dqkqd
Copy link
Contributor

dqkqd commented Jul 31, 2022

Issue description

I enabled shell complation for ZSH. When I press tab after $ pipenv install, KeyError: 'packages' was thrown.

$ pipenv install Traceback (most recent call last):
  File "/home/user/.local/bin/pipenv", line 8, in <module>
    sys.exit(cli())
  File "/home/user/.local/lib/python3.10/site-packages/pipenv/vendor/click/core.py", line 1128, in __call__
    return self.main(*args, **kwargs)
  File "/home/user/.local/lib/python3.10/site-packages/pipenv/cli/options.py", line 56, in main
    return super().main(*args, **kwargs, windows_expand_args=False)
  File "/home/user/.local/lib/python3.10/site-packages/pipenv/vendor/click/core.py", line 1048, in main
    self._main_shell_completion(extra, prog_name, complete_var)
  File "/home/user/.local/lib/python3.10/site-packages/pipenv/vendor/click/core.py", line 1123, in _main_shell_completion
    rv = shell_complete(self, ctx_args, prog_name, complete_var, instruction)
  File "/home/user/.local/lib/python3.10/site-packages/pipenv/vendor/click/shell_completion.py", line 49, in shell_complete
    echo(comp.complete())
  File "/home/user/.local/lib/python3.10/site-packages/pipenv/vendor/click/shell_completion.py", line 291, in complete
    completions = self.get_completions(args, incomplete)
  File "/home/user/.local/lib/python3.10/site-packages/pipenv/vendor/click/shell_completion.py", line 272, in get_completions
    obj, incomplete = _resolve_incomplete(ctx, args, incomplete)
  File "/home/user/.local/lib/python3.10/site-packages/pipenv/vendor/click/shell_completion.py", line 576, in _resolve_incomplete
    if _is_incomplete_argument(ctx, param):
  File "/home/user/.local/lib/python3.10/site-packages/pipenv/vendor/click/shell_completion.py", line 439, in _is_incomplete_argument
    value = ctx.params[param.name]
KeyError: 'packages'
pipenv         

Expected result

No exceptions thrown.

Steps to replicate

Enable shell-completion
Press tab after $ pipenv install.


Please run $ pipenv --support, and paste the results here. Don't put backticks (`) around it! The output already contains Markdown formatting.

$ pipenv --support

Pipenv version: '2022.7.24'

Pipenv location: '/home/user/.local/lib/python3.10/site-packages/pipenv'

Python location: '/usr/bin/python'

Python installations found:

  • 3.10.5: /usr/bin/python
  • 3.10.5: /usr/bin/python3

PEP 508 Information:

{'implementation_name': 'cpython',
 'implementation_version': '3.10.5',
 'os_name': 'posix',
 'platform_machine': 'x86_64',
 'platform_python_implementation': 'CPython',
 'platform_release': '5.18.14-arch1-1',
 'platform_system': 'Linux',
 'platform_version': '#1 SMP PREEMPT_DYNAMIC Sat, 23 Jul 2022 11:46:17 +0000',
 'python_full_version': '3.10.5',
 'python_version': '3.10',
 'sys_platform': 'linux'}

System environment variables:

  • ALACRITTY_LOG
  • ALACRITTY_SOCKET
  • ARCHFLAGS
  • COLORTERM
  • DBUS_SESSION_BUS_ADDRESS
  • DISPLAY
  • GTK_MODULES
  • HOME
  • I3SOCK
  • INVOCATION_ID
  • LANG
  • LANGUAGE
  • LC_ADDRESS
  • LC_COLLATE
  • LC_CTYPE
  • LC_IDENTIFICATION
  • LC_MEASUREMENT
  • LC_MESSAGES
  • LC_MONETARY
  • LC_NAME
  • LC_NUMERIC
  • LC_PAPER
  • LC_TELEPHONE
  • LC_TIME
  • LESS
  • LOGNAME
  • LSCOLORS
  • LS_COLORS
  • MAIL
  • MOTD_SHOWN
  • OLDPWD
  • P9K_SSH
  • PAGER
  • PATH
  • PWD
  • SHELL
  • SHLVL
  • SYSTEMD_EXEC_PID
  • TERM
  • USER
  • WINDOWID
  • WINDOWPATH
  • XAUTHORITY
  • XDG_RUNTIME_DIR
  • XDG_SEAT
  • XDG_SESSION_CLASS
  • XDG_SESSION_ID
  • XDG_SESSION_TYPE
  • XDG_VTNR
  • ZSH
  • ZSH_THEME
  • _
  • P9K_TTY
  • _P9K_TTY
  • PIP_SHIMS_BASE_MODULE
  • PIP_DISABLE_PIP_VERSION_CHECK
  • PIP_PYTHON_PATH
  • PYTHONDONTWRITEBYTECODE
  • PYTHONFINDER_IGNORE_UNSUPPORTED

Pipenv–specific environment variables:

Debug–specific environment variables:

  • PATH: /usr/local/sbin:/usr/local/bin:/usr/bin:/usr/lib/jvm/default/bin:/usr/bin/site_perl:/usr/bin/vendor_perl:/usr/bin/core_perl:/usr/lib/jvm/default/bin:/home/user/.local/bin:/home/user/.local/bin
  • SHELL: /usr/bin/zsh
  • LANG: en_US.UTF-8
  • PWD: /home/user/Documents

Contents of Pipfile ('/home/user/Documents/Pipfile'):

[[source]]
url = "https://pypi.org/simple"
verify_ssl = true
name = "pypi"

[packages]
black = "*"

[dev-packages]

[requires]
python_version = "3.10"

Contents of Pipfile.lock ('/home/user/Documents/Pipfile.lock'):

{
    "_meta": {
        "hash": {
            "sha256": "5581cbd1387cc3fa163c0c2013ac7ff6b1adefccec4183dfef6ec2ff70495dba"
        },
        "pipfile-spec": 6,
        "requires": {
            "python_version": "3.10"
        },
        "sources": [
            {
                "name": "pypi",
                "url": "https://pypi.org/simple",
                "verify_ssl": true
            }
        ]
    },
    "default": {
        "black": {
            "hashes": [
                "sha256:074458dc2f6e0d3dab7928d4417bb6957bb834434516f21514138437accdbe90",
                "sha256:187d96c5e713f441a5829e77120c269b6514418f4513a390b0499b0987f2ff1c",
                "sha256:2ea29072e954a4d55a2ff58971b83365eba5d3d357352a07a7a4df0d95f51c78",
                "sha256:4af5bc0e1f96be5ae9bd7aaec219c901a94d6caa2484c21983d043371c733fc4",
                "sha256:560558527e52ce8afba936fcce93a7411ab40c7d5fe8c2463e279e843c0328ee",
                "sha256:568ac3c465b1c8b34b61cd7a4e349e93f91abf0f9371eda1cf87194663ab684e",
                "sha256:6797f58943fceb1c461fb572edbe828d811e719c24e03375fd25170ada53825e",
                "sha256:6c1734ab264b8f7929cef8ae5f900b85d579e6cbfde09d7387da8f04771b51c6",
                "sha256:6c6d39e28aed379aec40da1c65434c77d75e65bb59a1e1c283de545fb4e7c6c9",
                "sha256:7ba9be198ecca5031cd78745780d65a3f75a34b2ff9be5837045dce55db83d1c",
                "sha256:94783f636bca89f11eb5d50437e8e17fbc6a929a628d82304c80fa9cd945f256",
                "sha256:a218d7e5856f91d20f04e931b6f16d15356db1c846ee55f01bac297a705ca24f",
                "sha256:a3db5b6409b96d9bd543323b23ef32a1a2b06416d525d27e0f67e74f1446c8f2",
                "sha256:ac609cf8ef5e7115ddd07d85d988d074ed00e10fbc3445aee393e70164a2219c",
                "sha256:b154e6bbde1e79ea3260c4b40c0b7b3109ffcdf7bc4ebf8859169a6af72cd70b",
                "sha256:b270a168d69edb8b7ed32c193ef10fd27844e5c60852039599f9184460ce0807",
                "sha256:b9fd45787ba8aa3f5e0a0a98920c1012c884622c6c920dbe98dbd05bc7c70fbf",
                "sha256:c85928b9d5f83b23cee7d0efcb310172412fbf7cb9d9ce963bd67fd141781def",
                "sha256:c9a3ac16efe9ec7d7381ddebcc022119794872abce99475345c5a61aa18c45ad",
                "sha256:cfaf3895a9634e882bf9d2363fed5af8888802d670f58b279b0bece00e9a872d",
                "sha256:e439798f819d49ba1c0bd9664427a05aab79bfba777a6db94fd4e56fae0cb849",
                "sha256:f586c26118bc6e714ec58c09df0157fe2d9ee195c764f630eb0d8e7ccce72e69",
                "sha256:f6fe02afde060bbeef044af7996f335fbe90b039ccf3f5eb8f16df8b20f77666"
            ],
            "index": "pypi",
            "version": "==22.6.0"
        },
        "click": {
            "hashes": [
                "sha256:7682dc8afb30297001674575ea00d1814d808d6a36af415a82bd481d37ba7b8e",
                "sha256:bb4d8133cb15a609f44e8213d9b391b0809795062913b383c62be0ee95b1db48"
            ],
            "markers": "python_version >= '3.7'",
            "version": "==8.1.3"
        },
        "mypy-extensions": {
            "hashes": [
                "sha256:090fedd75945a69ae91ce1303b5824f428daf5a028d2f6ab8a299250a846f15d",
                "sha256:2d82818f5bb3e369420cb3c4060a7970edba416647068eb4c5343488a6c604a8"
            ],
            "version": "==0.4.3"
        },
        "pathspec": {
            "hashes": [
                "sha256:7d15c4ddb0b5c802d161efc417ec1a2558ea2653c2e8ad9c19098201dc1c993a",
                "sha256:e564499435a2673d586f6b2130bb5b95f04a3ba06f81b8f895b651a3c76aabb1"
            ],
            "version": "==0.9.0"
        },
        "platformdirs": {
            "hashes": [
                "sha256:027d8e83a2d7de06bbac4e5ef7e023c02b863d7ea5d079477e722bb41ab25788",
                "sha256:58c8abb07dcb441e6ee4b11d8df0ac856038f944ab98b7be6b27b2a3c7feef19"
            ],
            "markers": "python_version >= '3.7'",
            "version": "==2.5.2"
        },
        "tomli": {
            "hashes": [
                "sha256:939de3e7a6161af0c887ef91b7d41a53e7c5a1ca976325f429cb46ea9bc30ecc",
                "sha256:de526c12914f0c550d15924c62d72abc48d6fe7364aa87328337a31007fe8a4f"
            ],
            "markers": "python_full_version < '3.11.0a7'",
            "version": "==2.0.1"
        }
    },
    "develop": {}
}
@matteius
Copy link
Member

matteius commented Aug 3, 2022

@dqkqd I have not been able to reproduce this issue so far on my mac iterm2 which I think is the only thing I have with zsh. It just lists the files when I hit tab -- nothing helpful related to the application usage though.

@dqkqd
Copy link
Contributor Author

dqkqd commented Aug 3, 2022

@matteius Have you enabled shell-completion as well?

@matteius
Copy link
Member

matteius commented Aug 3, 2022

Thanks @dqkqd that was what I was missing -- I was able to reproduce this issue with bash shell as well.

@matteius matteius added the Type: Bug 🐛 This issue is a bug. label Aug 3, 2022
@dqkqd
Copy link
Contributor Author

dqkqd commented Aug 3, 2022

@matteius Sorry, my steps to reproduce wasn't clear enough. Edited it.

@matteius
Copy link
Member

matteius commented Aug 7, 2022

Fix will be in the next release.

@matteius matteius closed this as completed Aug 7, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Type: Bug 🐛 This issue is a bug.
Projects
None yet
Development

No branches or pull requests

2 participants