Skip to content

EOFError when invalid credentials are provided for index #3088

Closed
@Vayel

Description

@Vayel

Issue description

When invalid credentials are provided for an index, a EOFError is raised.

Expected result

I expect either the credentials to be prompted in the command line or an exception to be raised if I configured pipenv this way (by setting prompting=False here).

Actual result

Pipfile.lock not found, creating…
Locking [dev-packages] dependencies…
Locking [packages] dependencies…
using sources: [{'url': 'https://pypi.org/simple', 'verify_ssl': True, 'name': 'pypi'}, {'url': 'https://v:p@simudyne.jfrog.io/simudyne/api/pypi/simudyne-pypi/simple', 'verify_ssl': True, 'name': 'simudyne_pypi'}]
Using pip: -i https://pypi.org/simple --extra-index-url https://v:p@simudyne.jfrog.io/simudyne/api/pypi/simudyne-pypi/simple

                          ROUND 1                           
Current constraints:
  ipykernel
  simudyne

Finding the best candidates:
User for simudyne.jfrog.io: 
Traceback (most recent call last):
  File "/home/simudyne/.local/lib/python3.6/site-packages/pipenv/resolver.py", line 101, in <module>
    main()
  File "/home/simudyne/.local/lib/python3.6/site-packages/pipenv/resolver.py", line 90, in main
    system=system,
  File "/home/simudyne/.local/lib/python3.6/site-packages/pipenv/resolver.py", line 73, in resolve
    allow_global=system,
  File "/home/simudyne/.local/lib/python3.6/site-packages/pipenv/utils.py", line 422, in resolve_deps
    req_dir=req_dir,
  File "/home/simudyne/.local/lib/python3.6/site-packages/pipenv/utils.py", line 302, in actually_resolve_deps
    results = resolver.resolve(max_rounds=environments.PIPENV_MAX_ROUNDS)
  File "/home/simudyne/.local/lib/python3.6/site-packages/pipenv/patched/piptools/resolver.py", line 102, in resolve
    has_changed, best_matches = self._resolve_one_round()
  File "/home/simudyne/.local/lib/python3.6/site-packages/pipenv/patched/piptools/resolver.py", line 198, in _resolve_one_round
    best_matches = {self.get_best_match(ireq) for ireq in constraints}
  File "/home/simudyne/.local/lib/python3.6/site-packages/pipenv/patched/piptools/resolver.py", line 198, in <setcomp>
    best_matches = {self.get_best_match(ireq) for ireq in constraints}
  File "/home/simudyne/.local/lib/python3.6/site-packages/pipenv/patched/piptools/resolver.py", line 263, in get_best_match
    best_match = self.repository.find_best_match(ireq, prereleases=self.prereleases)
  File "/home/simudyne/.local/lib/python3.6/site-packages/pipenv/patched/piptools/repositories/pypi.py", line 165, in find_best_match
    all_candidates = clean_requires_python(self.find_all_candidates(ireq.name))
  File "/home/simudyne/.local/lib/python3.6/site-packages/pipenv/patched/piptools/repositories/pypi.py", line 153, in find_all_candidates
    candidates = self.finder.find_all_candidates(req_name)
  File "/home/simudyne/.local/lib/python3.6/site-packages/pipenv/patched/notpip/_internal/index.py", line 479, in find_all_candidates
    for page in self._get_pages(url_locations, project_name):
  File "/home/simudyne/.local/lib/python3.6/site-packages/pipenv/patched/notpip/_internal/index.py", line 628, in _get_pages
    page = self._get_page(location)
  File "/home/simudyne/.local/lib/python3.6/site-packages/pipenv/patched/notpip/_internal/index.py", line 746, in _get_page
    return HTMLPage.get_page(link, session=self.session)
  File "/home/simudyne/.local/lib/python3.6/site-packages/pipenv/patched/notpip/_internal/index.py", line 855, in get_page
    "Cache-Control": "max-age=600",
  File "/home/simudyne/.local/lib/python3.6/site-packages/pipenv/patched/notpip/_vendor/requests/sessions.py", line 525, in get
    return self.request('GET', url, **kwargs)
  File "/home/simudyne/.local/lib/python3.6/site-packages/pipenv/patched/notpip/_internal/download.py", line 397, in request
    return super(PipSession, self).request(method, url, *args, **kwargs)
  File "/home/simudyne/.local/lib/python3.6/site-packages/pipenv/patched/notpip/_vendor/requests/sessions.py", line 512, in request
    resp = self.send(prep, **send_kwargs)
  File "/home/simudyne/.local/lib/python3.6/site-packages/pipenv/patched/notpip/_vendor/requests/sessions.py", line 629, in send
    r = dispatch_hook('response', hooks, r, **kwargs)
  File "/home/simudyne/.local/lib/python3.6/site-packages/pipenv/patched/notpip/_vendor/requests/hooks.py", line 31, in dispatch_hook
    _hook_data = hook(hook_data, **kwargs)
  File "/home/simudyne/.local/lib/python3.6/site-packages/pipenv/patched/notpip/_internal/download.py", line 189, in handle_401
    username = six.moves.input("User for %s: " % parsed.netloc)
EOFError: EOF when reading a line

Steps to replicate

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

[[source]]
url = "https://${SIMUDYNE_USER}:${SIMUDYNE_PASSWORD}@simudyne.jfrog.io/simudyne/api/pypi/simudyne-pypi/simple"
verify_ssl = true
name = "simudyne_pypi"

[packages]
ipykernel = "*"
simudyne = {version = "*", index = "simudyne_pypi"}
export SIMUDYNE_USER="valid_or_invalid_user"
export SIMUDYNE_PASSWORD="invalid_password"
pipenv install

$ pipenv --support

Pipenv version: '2018.10.13'

Pipenv location: '/home/simudyne/.local/lib/python3.6/site-packages/pipenv'

Python location: '/home/simudyne/anaconda3/bin/python3'

Python installations found:

  • 3.6.6: /usr/bin/python3.6
  • 3.6.6: /usr/bin/python3.6m
  • 2.7.15rc1: /usr/bin/python2.7

PEP 508 Information:

{'implementation_name': 'cpython',
 'implementation_version': '3.6.4',
 'os_name': 'posix',
 'platform_machine': 'x86_64',
 'platform_python_implementation': 'CPython',
 'platform_release': '4.15.0-36-generic',
 'platform_system': 'Linux',
 'platform_version': '#39-Ubuntu SMP Mon Sep 24 16:19:09 UTC 2018',
 'python_full_version': '3.6.4',
 'python_version': '3.6',
 'sys_platform': 'linux'}

System environment variables:

  • CLUTTER_IM_MODULE
  • SIMUDYNE_PASSWORD
  • LS_COLORS
  • LESSCLOSE
  • XDG_MENU_PREFIX
  • LANG
  • GDM_LANG
  • DISPLAY
  • OLDPWD
  • GTK2_MODULES
  • COLORTERM
  • XDG_VTNR
  • SSH_AUTH_SOCK
  • MANDATORY_PATH
  • XDG_SESSION_ID
  • XDG_GREETER_DATA_DIR
  • USER
  • DESKTOP_SESSION
  • QT4_IM_MODULE
  • TEXTDOMAINDIR
  • GNOME_TERMINAL_SCREEN
  • DEFAULTS_PATH
  • QT_QPA_PLATFORMTHEME
  • PWD
  • HOME
  • TEXTDOMAIN
  • SSH_AGENT_PID
  • QT_ACCESSIBILITY
  • XDG_SESSION_TYPE
  • XDG_DATA_DIRS
  • XDG_SESSION_DESKTOP
  • GJS_DEBUG_OUTPUT
  • GTK_MODULES
  • TERM
  • SHELL
  • VTE_VERSION
  • XDG_SEAT_PATH
  • QT_IM_MODULE
  • XMODIFIERS
  • IM_CONFIG_PHASE
  • XDG_CURRENT_DESKTOP
  • GPG_AGENT_INFO
  • GNOME_TERMINAL_SERVICE
  • XDG_SEAT
  • SHLVL
  • LANGUAGE
  • GDMSESSION
  • GNOME_DESKTOP_SESSION_ID
  • LOGNAME
  • DBUS_SESSION_BUS_ADDRESS
  • XDG_RUNTIME_DIR
  • XAUTHORITY
  • XDG_SESSION_PATH
  • XDG_CONFIG_DIRS
  • PATH
  • GJS_DEBUG_TOPICS
  • SESSION_MANAGER
  • SIMUDYNE_USER
  • LESSOPEN
  • GTK_IM_MODULE
  • _
  • PYTHONDONTWRITEBYTECODE
  • PIP_SHIMS_BASE_MODULE
  • PIP_PYTHON_PATH

Pipenv–specific environment variables:

Debug–specific environment variables:

  • PATH: /home/simudyne/anaconda3/bin:/home/simudyne/bin:/home/simudyne/.local/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/snap/bin
  • SHELL: /bin/bash
  • LANG: en_GB.UTF-8
  • PWD: /tmp/python-client-app-example

Contents of Pipfile ('/tmp/python-client-app-example/Pipfile'):

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

[[source]]
url = "https://${SIMUDYNE_USER}:${SIMUDYNE_PASSWORD}@simudyne.jfrog.io/simudyne/api/pypi/simudyne-pypi/simple"
verify_ssl = true
name = "simudyne_pypi"

[packages]
ipykernel = "*"
simudyne = {version = "*", index = "simudyne_pypi"}

Metadata

Metadata

Assignees

Labels

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions