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

JSONDecodeError while locking if pythonwarning is tirggered #3273

Maks3w opened this Issue Nov 21, 2018 · 2 comments


None yet
2 participants

Maks3w commented Nov 21, 2018

Issue description

With PYTHONWARNINGS=once pipenv fails because warning is appended to JSON generated lock

Actual result

[{"version": "18.2.0", "hashes": ["sha256:10cbf6e27dbce8c30807caf056c8eb50917e0eaafe86347671b57254......, {"version": "4.0.0", "index": "pypi", "hashes": ["sha256:488c842647bbeb350029da10325cb40af0a9c7a2fdda45aeb1dda75b60048ffb", "sha256:c055690dfefa744992f563e8c3a654089a6aa5b8092dded9b6fafbd70b2e45a7"], "name": "pytest"}]/usr/local/lib/python3.6/site-packages/pipenv/patched/notpip/_vendor/msgpack/ PendingDeprecationWarning: encoding is deprecated, Use raw=False instead.

Traceback (most recent call last):
  File "/usr/local/lib/python3.6/site-packages/pipenv/", line 636, in venv_resolve_deps
    results = json.loads(results.split("RESULTS:")[1].strip())
  File "/usr/local/lib/python3.6/json/", line 354, in loads
    return _default_decoder.decode(s)
  File "/usr/local/lib/python3.6/json/", line 342, in decode
    raise JSONDecodeError("Extra data", s, end)
json.decoder.JSONDecodeError: Extra data: line 1 column 9648 (char 9647)

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/usr/local/bin/pipenv", line 11, in <module>
  File "/usr/local/lib/python3.6/site-packages/pipenv/vendor/click/", line 764, in __call__
    return self.main(*args, **kwargs)
  File "/usr/local/lib/python3.6/site-packages/pipenv/vendor/click/", line 717, in main
    rv = self.invoke(ctx)
  File "/usr/local/lib/python3.6/site-packages/pipenv/vendor/click/", line 1137, in invoke
    return _process_result(sub_ctx.command.invoke(sub_ctx))
  File "/usr/local/lib/python3.6/site-packages/pipenv/vendor/click/", line 956, in invoke
    return ctx.invoke(self.callback, **ctx.params)
  File "/usr/local/lib/python3.6/site-packages/pipenv/vendor/click/", line 555, in invoke
    return callback(*args, **kwargs)
  File "/usr/local/lib/python3.6/site-packages/pipenv/vendor/click/", line 64, in new_func
    return ctx.invoke(f, obj, *args, **kwargs)
  File "/usr/local/lib/python3.6/site-packages/pipenv/vendor/click/", line 555, in invoke
    return callback(*args, **kwargs)
  File "/usr/local/lib/python3.6/site-packages/pipenv/vendor/click/", line 17, in new_func
    return f(get_current_context(), *args, **kwargs)
  File "/usr/local/lib/python3.6/site-packages/pipenv/cli/", line 325, in lock
  File "/usr/local/lib/python3.6/site-packages/pipenv/", line 1047, in do_lock
  File "/usr/local/lib/python3.6/site-packages/pipenv/", line 649, in venv_resolve_deps
    raise RuntimeError("There was a problem with locking.")
RuntimeError: There was a problem with locking.

Workaround is set PYTHONWARNINGS=ignore


This comment was marked as off-topic.

duplicate-issues bot commented Nov 21, 2018

Hey @Maks3w,

We did a quick check and this issue looks very darn similar to

This could be a coincidence, but if any of these issues solves your problem then I did a good job 😄

If not, the maintainers will get to this issue shortly.

Your Friendly Neighborhood ProBot


This comment has been minimized.


techalchemy commented Nov 21, 2018

Hm the solution is to get warnings to write to stderr...

techalchemy added a commit that referenced this issue Nov 21, 2018

Write warnings to stderr during resolution
- Fixes #3273

Signed-off-by: Dan Ryan <>

@techalchemy techalchemy added this to the November Bugfix Release milestone Nov 21, 2018

@techalchemy techalchemy self-assigned this Nov 21, 2018

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment