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

Don't crash on un-stringable exceptions #1359

Merged
merged 1 commit into from Mar 10, 2020
Merged

Conversation

asottile
Copy link
Member

Resolves #1358

I was able to reproduce and then fix the crash -- also fixed arbitrary errors in __str__ though I think those are nearly impossible

(the output below was retrieved by intentionally breaking virtualenv.py to print some garbage and then crash)

$ pre-commit run flake8 --all-files
[INFO] Initializing environment for https://gitlab.com/pycqa/flake8:astpretty==1,flake8-typing-imports==1.6.0.
[INFO] Installing environment for https://gitlab.com/pycqa/flake8.
[INFO] Once installed this environment will be reused.
[INFO] This may take a few minutes...
An unexpected error has occurred: CalledProcessError: command: ('/home/asottile/workspace/pre-commit/venv/bin/python3', '-mvirtualenv', '/home/asottile/.cache/pre-commit/repo0gp5o4dq/py_env-python3', '-p', '/home/asottile/workspace/pre-commit/venv/bin/python3')
return code: 1
expected return code: 0
stdout:
    ��
stderr: (none)
Check the log at /home/asottile/.cache/pre-commit/pre-commit.log

@asottile asottile merged commit 1c10340 into master Mar 10, 2020
@asottile asottile deleted the bytesable_exceptions branch March 10, 2020 16:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

Running pre-commit with Python installed from Windows Store raises UnicodeDecodeError
1 participant