-
-
Notifications
You must be signed in to change notification settings - Fork 2.9k
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
MyPy daemon version 1.7.0+ crashes if colorama is installed and reporting (cubertura) is used. #16678
Labels
Comments
AlexWaygood
added
crash
topic-daemon
dmypy
and removed
bug
mypy got something wrong
labels
Dec 19, 2023
Also ran into this issue and I am not use cobertura, but do have colorama installed. Not sure if the django mypy plugins is causing it to be used but its the same crash. Update: django mypy plugin initializes django with initializes colorama |
Work around:
|
meshy
added a commit
to meshy/mypy
that referenced
this issue
Jan 19, 2024
This class replaced stdout and stderr to capture output, but caused issues because it didn't implement the full API of sys.stdout and sys.stderr. By fully stubbing the TextIO API we prevent issues with other code which uses more of the API than we had previously accounted for. Fixes python#16678
I've written a PR which I hope addresses this issue. |
meshy
added a commit
to meshy/mypy
that referenced
this issue
Jan 19, 2024
This class replaced stdout and stderr to capture output, but caused issues because it didn't implement the full API of sys.stdout and sys.stderr. By fully stubbing the TextIO API we prevent issues with other code which uses more of the API than we had previously accounted for. Fixes python#16678
meshy
added a commit
to meshy/mypy
that referenced
this issue
Jan 19, 2024
This class replaced stdout and stderr to capture output, but caused issues because it didn't implement the full API of sys.stdout and sys.stderr. By fully stubbing the TextIO API we prevent issues with other code which uses more of the API than we had previously accounted for. Fixes python#16678
meshy
added a commit
to meshy/mypy
that referenced
this issue
Jan 20, 2024
This class replaced stdout and stderr to capture output, but caused issues because it didn't implement the full API of sys.stdout and sys.stderr. By fully stubbing the TextIO API we prevent issues with other code which uses more of the API than we had previously accounted for. Fixes python#16678
meshy
added a commit
to meshy/mypy
that referenced
this issue
Jan 20, 2024
This class replaced stdout and stderr to capture output, but caused issues because it didn't implement the full API of sys.stdout and sys.stderr. By fully stubbing the TextIO API we prevent issues with other code which uses more of the API than we had previously accounted for. Fixes python#16678
hauntsaninja
pushed a commit
that referenced
this issue
Jan 30, 2024
`WriteToConn` replaces stdout and stderr to capture output, but causes issues because it doesn't implement the `TextIO` API (as expected of `sys.stdout` and `sys.stderr`). By stubbing the rest of the `TextIO` API we prevent issues with other code which uses more of the API than we had previously accounted for. Fixes #16678
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Bug Report
MyPy daemon version 1.7.0+ crashes if
colorama
is installed and reporting (cubertura) is used.The issue is related to this MR: #16252
The wrapper should implement "ALL" abstract method to make sure that it is not broken somewhere down the stream. IO has standard interface which can be used anywhere in the code (plugins or other 3rd party libraries).
More specifically the wrapper does not implement
flush
which is used incolorama
To Reproduce
Install latest:
Run
dmypy run
with cubertura reporting enabled in config fileIn
pyproject.toml
ormypy.ini
put the following lines:Expected Behavior
MyPy daemon should not crash
Actual Behavior
MyPy daemon crash with exception:
Your Environment
mypy.ini
(and other config files):The text was updated successfully, but these errors were encountered: