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

Closed
Maks3w opened this Issue Nov 21, 2018 · 2 comments

Comments

Projects
None yet
2 participants
@Maks3w

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/fallback.py:222: PendingDeprecationWarning: encoding is deprecated, Use raw=False instead.
  PendingDeprecationWarning)


Traceback (most recent call last):
  File "/usr/local/lib/python3.6/site-packages/pipenv/utils.py", line 636, in venv_resolve_deps
    results = json.loads(results.split("RESULTS:")[1].strip())
  File "/usr/local/lib/python3.6/json/__init__.py", line 354, in loads
    return _default_decoder.decode(s)
  File "/usr/local/lib/python3.6/json/decoder.py", 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>
    sys.exit(cli())
  File "/usr/local/lib/python3.6/site-packages/pipenv/vendor/click/core.py", line 764, in __call__
    return self.main(*args, **kwargs)
  File "/usr/local/lib/python3.6/site-packages/pipenv/vendor/click/core.py", line 717, in main
    rv = self.invoke(ctx)
  File "/usr/local/lib/python3.6/site-packages/pipenv/vendor/click/core.py", line 1137, in invoke
    return _process_result(sub_ctx.command.invoke(sub_ctx))
  File "/usr/local/lib/python3.6/site-packages/pipenv/vendor/click/core.py", line 956, in invoke
    return ctx.invoke(self.callback, **ctx.params)
  File "/usr/local/lib/python3.6/site-packages/pipenv/vendor/click/core.py", line 555, in invoke
    return callback(*args, **kwargs)
  File "/usr/local/lib/python3.6/site-packages/pipenv/vendor/click/decorators.py", line 64, in new_func
    return ctx.invoke(f, obj, *args, **kwargs)
  File "/usr/local/lib/python3.6/site-packages/pipenv/vendor/click/core.py", line 555, in invoke
    return callback(*args, **kwargs)
  File "/usr/local/lib/python3.6/site-packages/pipenv/vendor/click/decorators.py", line 17, in new_func
    return f(get_current_context(), *args, **kwargs)
  File "/usr/local/lib/python3.6/site-packages/pipenv/cli/command.py", line 325, in lock
    pypi_mirror=state.pypi_mirror,
  File "/usr/local/lib/python3.6/site-packages/pipenv/core.py", line 1047, in do_lock
    lockfile=lockfile
  File "/usr/local/lib/python3.6/site-packages/pipenv/utils.py", 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

@duplicate-issues

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.

Cheers,
Your Friendly Neighborhood ProBot

@techalchemy

This comment has been minimized.

Member

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 <dan@danryan.co>

@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