Repository navigation
Use SupportsWrite instead of IO - #5069
Merged
Merged
Conversation
Contributor
|
Diff from mypy_primer, showing the effect of this PR on open source code: pip (https://github.com/pypa/pip.git)
- src/pip/_internal/utils/logging.py:169: error: Incompatible types in assignment (expression has type "AnsiToWin32", variable has type "IO[str]")
sphinx (https://github.com/sphinx-doc/sphinx.git)
+ sphinx/util/logging.py:575: error: unused 'type: ignore' comment
+ sphinx/util/logging.py:581: error: unused 'type: ignore' comment
+ sphinx/util/logging.py:589: error: unused 'type: ignore' comment
zulip (https://github.com/zulip/zulip.git)
+ zerver/lib/test_console_output.py:69: error: unused 'type: ignore' comment
pytest (https://github.com/pytest-dev/pytest.git)
+ src/_pytest/logging.py:629: error: "SupportsWrite[str]" has no attribute "close" [attr-defined]
|
Collaborator
Author
|
It seems this PR fixes a bunch of issues. The new failure in pytest points to a real unsafe use (even if this is most likely not a problem in practice). |
JelleZijlstra
approved these changes
Mar 23, 2021
JelleZijlstra
left a comment
Member
There was a problem hiding this comment.
Looks good, I fixed the merge conflict. I'll merge once CI is green (unless I get distracted).
Contributor
|
Diff from mypy_primer, showing the effect of this PR on open source code: sphinx (https://github.com/sphinx-doc/sphinx.git)
+ sphinx/util/logging.py:575: error: unused 'type: ignore' comment
+ sphinx/util/logging.py:581: error: unused 'type: ignore' comment
+ sphinx/util/logging.py:589: error: unused 'type: ignore' comment
pip (https://github.com/pypa/pip.git)
- src/pip/_internal/utils/logging.py:169: error: Incompatible types in assignment (expression has type "AnsiToWin32", variable has type "IO[str]")
zulip (https://github.com/zulip/zulip.git)
+ zerver/lib/test_console_output.py:69: error: unused 'type: ignore' comment
pytest (https://github.com/pytest-dev/pytest.git)
+ src/_pytest/logging.py:629: error: "SupportsWrite[str]" has no attribute "close" [attr-defined]
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Depends on #5068.