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

pipenv: Ignore additional pipenv output #41

Merged
merged 1 commit into from
Nov 6, 2024

Conversation

qsuscs
Copy link
Contributor

@qsuscs qsuscs commented Aug 14, 2024

Pipenv can print additional output that would end up in our variables, e. g., if a .env file exists, python-shell-virtualenv-root ends up as Loading .env environment variables...\n/home/user/.local/share/virtualenvs/project.

This change is to:

  1. call pipenv with --quiet, so that it does not print extra information in the first place;
  2. pass '(t nil) as buffer argument to process-file, so that it ignores stderr and the buffer only contains stdout.

This issue may also exist with other backends, I did not check those. On a side note, it would be cool if one could supply arbitrary backends, instead of hard-ish-coding everything in pet-virtualenv-root, but that’s probably a significant rewrite and a different issue.

Pipenv can print additional output that would end up in our variables, e. g., if
a `.env` file exists, `python-shell-virtualenv-root` ends up as `Loading .env
environment variables...\n/home/user/.local/share/virtualenvs/project`.

This change is to:

a) call pipenv with `--quiet`, so that it does not print extra information in
   the first place;

b) pass `'(t nil)` as `buffer` argument to `process-file`, so that it ignores
   stderr and the buffer only contains stdout.

Signed-off-by: Thomas Schneider <[email protected]>
@wyuenho
Copy link
Owner

wyuenho commented Nov 6, 2024

Thank you!

@wyuenho wyuenho merged commit f9e8106 into wyuenho:main Nov 6, 2024
10 of 11 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants