You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
If the Pipfile.lock is invalid json, e.g. like this example which has a merge conflict, pipenv crashes with a JSONDecodeError
Expected result
Pipenv would either print an error that the Pipfile.lock is invalid or override the invalid file (I'd prefer the latter).
Actual result
$ pipenv install
Traceback (most recent call last):
File "/usr/local/bin/pipenv", line 11, in <module>
sys.exit(cli())
File "/home/konsti/.local/lib/python3.6/site-packages/pipenv/vendor/click/core.py", line 722, in __call__
return self.main(*args, **kwargs)
File "/home/konsti/.local/lib/python3.6/site-packages/pipenv/vendor/click/core.py", line 697, in main
rv = self.invoke(ctx)
File "/home/konsti/.local/lib/python3.6/site-packages/pipenv/vendor/click/core.py", line 1066, in invoke
return _process_result(sub_ctx.command.invoke(sub_ctx))
File "/home/konsti/.local/lib/python3.6/site-packages/pipenv/vendor/click/core.py", line 895, in invoke
return ctx.invoke(self.callback, **ctx.params)
File "/home/konsti/.local/lib/python3.6/site-packages/pipenv/vendor/click/core.py", line 535, in invoke
return callback(*args, **kwargs)
File "/home/konsti/.local/lib/python3.6/site-packages/pipenv/cli.py", line 435, in install
selective_upgrade=selective_upgrade,
File "/home/konsti/.local/lib/python3.6/site-packages/pipenv/core.py", line 1943, in do_install
pypi_mirror=pypi_mirror,
File "/home/konsti/.local/lib/python3.6/site-packages/pipenv/core.py", line 1245, in do_init
old_hash = project.get_lockfile_hash()
File "/home/konsti/.local/lib/python3.6/site-packages/pipenv/project.py", line 785, in get_lockfile_hash
lockfile = self.load_lockfile(expand_env_vars=False)
File "/home/konsti/.local/lib/python3.6/site-packages/pipenv/project.py", line 768, in load_lockfile
j = json.load(lock)
File "/usr/lib/python3.6/json/__init__.py", line 299, in load
parse_constant=parse_constant, object_pairs_hook=object_pairs_hook, **kw)
File "/usr/lib/python3.6/json/__init__.py", line 354, in loads
return _default_decoder.decode(s)
File "/usr/lib/python3.6/json/decoder.py", line 339, in decode
obj, end = self.raw_decode(s, idx=_w(s, 0).end())
File "/usr/lib/python3.6/json/decoder.py", line 355, in raw_decode
obj, end = self.scan_once(s, idx)
json.decoder.JSONDecodeError: Expecting property name enclosed in double quotes: line 4 column 1 (char 35)
Issue description
If the Pipfile.lock is invalid json, e.g. like this example which has a merge conflict, pipenv crashes with a JSONDecodeError
Expected result
Pipenv would either print an error that the Pipfile.lock is invalid or override the invalid file (I'd prefer the latter).
Actual result
Steps to replicate
Create a folder with this Pipfile and this Pipfile.lock. Run
pipenv install
$ pipenv --support
Pipenv version:
'2018.7.1'
Pipenv location:
'/home/konsti/.local/lib/python3.6/site-packages/pipenv'
Python location:
'/usr/bin/python3'
Other Python installations in
PATH
:2.7
:/usr/bin/python2.7
2.7
:/usr/bin/python2.7
3.5
:/usr/bin/python3.5m
3.5
:/usr/bin/python3.5
3.6
:/usr/bin/python3.6m
3.6
:/usr/bin/python3.6
2.7.15
:/usr/bin/python
2.7.15
:/usr/bin/python2
3.6.5
:/usr/bin/python3
PEP 508 Information:
System environment variables:
CLUTTER_IM_MODULE
PIPENV_VENV_IN_PROJECT
LS_COLORS
PIPENV_DONT_LOAD_ENV
LC_MEASUREMENT
LESSCLOSE
LC_PAPER
LC_MONETARY
XDG_MENU_PREFIX
LANG
GDM_LANG
MANAGERPID
DISPLAY
OLDPWD
INVOCATION_ID
UNITY_DEFAULT_PROFILE
NODE_PATH
COMPIZ_CONFIG_PROFILE
GTK2_MODULES
COLORTERM
SSH_AUTH_SOCK
MANDATORY_PATH
LC_NAME
XDG_GREETER_DATA_DIR
USER
DESKTOP_SESSION
QT4_IM_MODULE
TEXTDOMAINDIR
GNOME_TERMINAL_SCREEN
DEFAULTS_PATH
PWD
HOME
JOURNAL_STREAM
TEXTDOMAIN
QT_ACCESSIBILITY
LIBVIRT_DEFAULT_URI
XDG_SESSION_TYPE
COMPIZ_BIN_PATH
XDG_DATA_DIRS
XDG_SESSION_DESKTOP
LC_ADDRESS
SSH_AGENT_LAUNCHER
LC_NUMERIC
TEXMFHOME
GTK_MODULES
PAPERSIZE
GNOME_SESSION_XDG_SESSION_PATH
TERM
VTE_VERSION
SHELL
XDG_SEAT_PATH
QT_IM_MODULE
XMODIFIERS
IM_CONFIG_PHASE
XDG_CURRENT_DESKTOP
GPG_AGENT_INFO
GNOME_TERMINAL_SERVICE
UNITY_HAS_3D_SUPPORT
SHLVL
LANGUAGE
LC_TELEPHONE
GDMSESSION
GNOME_DESKTOP_SESSION_ID
LOGNAME
DBUS_SESSION_BUS_ADDRESS
XDG_RUNTIME_DIR
XAUTHORITY
XDG_SESSION_PATH
XDG_CONFIG_DIRS
PATH
LC_IDENTIFICATION
SESSION_MANAGER
LESSOPEN
GTK_IM_MODULE
LC_TIME
_
PYTHONDONTWRITEBYTECODE
PIP_PYTHON_PATH
Pipenv–specific environment variables:
PIPENV_VENV_IN_PROJECT
:True
PIPENV_DONT_LOAD_ENV
:1
Debug–specific environment variables:
PATH
:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/snap/bin:/home/konsti/.cargo/bin:/home/konsti/.local/bin
SHELL
:/bin/bash
LANG
:de_DE.UTF-8
PWD
:/home/konsti/hyperjson
Contents of
Pipfile
('/home/konsti/hyperjson/Pipfile'):Contents of
Pipfile.lock
('/home/konsti/hyperjson/Pipfile.lock'):The text was updated successfully, but these errors were encountered: