Skip to content

[typing] Change IO.name to str | bytes - #16860

Closed
srittau wants to merge 5 commits into
python:mainfrom
srittau:io-name
Closed

srittau wants to merge 5 commits into
python:mainfrom
srittau:io-name

Conversation

@srittau

@srittau srittau commented Nov 18, 2026 •

Copy link
Copy Markdown
Collaborator

Experimental alternative to #13624. Has been tried before in a similar manner in #10738.

In theory this is the best alternative, since return types should be concrete, and concrete sub-classes should narrow the type down. On the other hand, a function accepting f: IO and accessing f.name without checking the type is unsafe and might have a real bug.

SocketIO is the only class in the stdlib that returns int for name, and it is not derived from IO. This means we can safely remove int from the return type.

@github-actions

This comment has been minimized.

@github-actions

This comment has been minimized.

@srittau srittau changed the title [typing] Change IO.name to str | bytes | int [typing] Change IO.name to str | bytes Nov 18, 2026
@github-actions

Copy link
Copy Markdown
Contributor

Diff from mypy_primer, showing the effect of this PR on open source code:

pip (https://github.com/pypa/pip)
+ src/pip/_internal/utils/filesystem.py:165: error: Argument 1 to "chmod" has incompatible type "object"; expected "int | str | bytes | PathLike[str] | PathLike[bytes]"  [arg-type]
+ src/pip/_internal/operations/install/wheel.py:482: error: Argument 1 to "chmod" has incompatible type "object"; expected "int | str | bytes | PathLike[str] | PathLike[bytes]"  [arg-type]
+ src/pip/_internal/operations/install/wheel.py:483: error: Argument 1 has incompatible type "object"; expected "str | bytes | PathLike[str] | PathLike[bytes]"  [arg-type]
+ src/pip/_internal/operations/install/wheel.py:487: error: Argument 1 to "unlink" has incompatible type "object"; expected "str | bytes | PathLike[str] | PathLike[bytes]"  [arg-type]
+ src/pip/_internal/network/cache.py:91: error: Argument 1 has incompatible type "object"; expected "str | bytes | PathLike[str] | PathLike[bytes]"  [arg-type]
+ src/pip/_internal/network/download.py:360: error: No overload variant of "open" matches argument types "object", "str"  [call-overload]
+ src/pip/_internal/network/download.py:360: note: Possible overload variants:
+ src/pip/_internal/network/download.py:360: note:     def open(file: int | str | bytes | PathLike[str] | PathLike[bytes], mode: Literal['r+', '+r', 'rt+', 'r+t', '+rt', 'tr+', 't+r', '+tr', 'w+', '+w', 'wt+', 'w+t', '+wt', 'tw+', 't+w', '+tw', 'a+', '+a', 'at+', 'a+t', '+at', 'ta+', 't+a', '+ta', 'x+', '+x', 'xt+', 'x+t', '+xt', 'tx+', 't+x', '+tx'] | Literal['w', 'wt', 'tw', 'a', 'at', 'ta', 'x', 'xt', 'tx'] | Literal['r', 'rt', 'tr', 'U', 'rU', 'Ur', 'rtU', 'rUt', 'Urt', 'trU', 'tUr', 'Utr'] = ..., buffering: int = ..., encoding: str | None = ..., errors: str | None = ..., newline: str | None = ..., closefd: bool = ..., opener: Callable[[str, int], int] | None = ...) -> TextIOWrapper[_WrappedBuffer]
+ src/pip/_internal/network/download.py:360: note:     def [_FileT: int | str | bytes | PathLike[str] | PathLike[bytes]] open(file: _FileT, mode: Literal['rb+', 'r+b', '+rb', 'br+', 'b+r', '+br', 'wb+', 'w+b', '+wb', 'bw+', 'b+w', '+bw', 'ab+', 'a+b', '+ab', 'ba+', 'b+a', '+ba', 'xb+', 'x+b', '+xb', 'bx+', 'b+x', '+bx'] | Literal['rb', 'br', 'rbU', 'rUb', 'Urb', 'brU', 'bUr', 'Ubr'] | Literal['wb', 'bw', 'ab', 'ba', 'xb', 'bx'], buffering: Literal[0], encoding: None = ..., errors: None = ..., newline: None = ..., closefd: bool = ..., opener: Callable[[str, int], int] | None = ...) -> FileIO[_FileT]
+ src/pip/_internal/network/download.py:360: note:     def open(file: int | str | bytes | PathLike[str] | PathLike[bytes], mode: Literal['rb+', 'r+b', '+rb', 'br+', 'b+r', '+br', 'wb+', 'w+b', '+wb', 'bw+', 'b+w', '+bw', 'ab+', 'a+b', '+ab', 'ba+', 'b+a', '+ba', 'xb+', 'x+b', '+xb', 'bx+', 'b+x', '+bx'], buffering: Literal[-1, 1] = ..., encoding: None = ..., errors: None = ..., newline: None = ..., closefd: bool = ..., opener: Callable[[str, int], int] | None = ...) -> BufferedRandom
+ src/pip/_internal/network/download.py:360: note:     def open(file: int | str | bytes | PathLike[str] | PathLike[bytes], mode: Literal['wb', 'bw', 'ab', 'ba', 'xb', 'bx'], buffering: Literal[-1, 1] = ..., encoding: None = ..., errors: None = ..., newline: None = ..., closefd: bool = ..., opener: Callable[[str, int], int] | None = ...) -> BufferedWriter[_BufferedWriterStream]
+ src/pip/_internal/network/download.py:360: note:     def open(file: int | str | bytes | PathLike[str] | PathLike[bytes], mode: Literal['rb', 'br', 'rbU', 'rUb', 'Urb', 'brU', 'bUr', 'Ubr'], buffering: Literal[-1, 1] = ..., encoding: None = ..., errors: None = ..., newline: None = ..., closefd: bool = ..., opener: Callable[[str, int], int] | None = ...) -> BufferedReader[_BufferedReaderStream]
+ src/pip/_internal/network/download.py:360: note:     def open(file: int | str | bytes | PathLike[str] | PathLike[bytes], mode: Literal['rb+', 'r+b', '+rb', 'br+', 'b+r', '+br', 'wb+', 'w+b', '+wb', 'bw+', 'b+w', '+bw', 'ab+', 'a+b', '+ab', 'ba+', 'b+a', '+ba', 'xb+', 'x+b', '+xb', 'bx+', 'b+x', '+bx'] | Literal['rb', 'br', 'rbU', 'rUb', 'Urb', 'brU', 'bUr', 'Ubr'] | Literal['wb', 'bw', 'ab', 'ba', 'xb', 'bx'], buffering: int = ..., encoding: None = ..., errors: None = ..., newline: None = ..., closefd: bool = ..., opener: Callable[[str, int], int] | None = ...) -> BinaryIO
+ src/pip/_internal/network/download.py:360: note:     def open(file: int | str | bytes | PathLike[str] | PathLike[bytes], mode: str, buffering: int = ..., encoding: str | None = ..., errors: str | None = ..., newline: str | None = ..., closefd: bool = ..., opener: Callable[[str, int], int] | None = ...) -> IO[Any]
+ src/pip/_internal/self_outdated_check.py:128: error: Argument 1 has incompatible type "object"; expected "str | bytes | PathLike[str] | PathLike[bytes]"  [arg-type]

pwndbg (https://github.com/pwndbg/pwndbg)
+ pwndbg/color/syntax_highlight.py:11: note: In module imported here:
+ pwndbg/dbg_mod/lldb/repl/__init__.py: note: In function "run":
+ pwndbg/dbg_mod/lldb/repl/__init__.py:401: error: Cannot instantiate abstract class "TextIOWrapper" with abstract attribute "name"  [abstract]

optuna (https://github.com/optuna/optuna)
+ tests/storages_tests/rdb_tests/test_storage.py:87: error: No overload variant of "__add__" of "str" matches argument type "object"  [operator]
+ tests/storages_tests/rdb_tests/test_storage.py:87: note: Possible overload variants:
+ tests/storages_tests/rdb_tests/test_storage.py:87: note:     def __add__(self, str, /) -> str
+ tests/storages_tests/rdb_tests/test_storage.py:96: error: No overload variant of "__add__" of "str" matches argument type "object"  [operator]
+ tests/storages_tests/rdb_tests/test_storage.py:96: note: Possible overload variants:
+ tests/storages_tests/rdb_tests/test_storage.py:96: note:     def __add__(self, str, /) -> str
+ tests/storages_tests/rdb_tests/test_storage.py:100: error: No overload variant of "__add__" of "str" matches argument type "object"  [operator]
+ tests/storages_tests/rdb_tests/test_storage.py:100: note: Possible overload variants:
+ tests/storages_tests/rdb_tests/test_storage.py:100: note:     def __add__(self, str, /) -> str
+ tests/storages_tests/rdb_tests/test_storage.py:104: error: No overload variant of "__add__" of "str" matches argument type "object"  [operator]
+ tests/storages_tests/rdb_tests/test_storage.py:104: note: Possible overload variants:
+ tests/storages_tests/rdb_tests/test_storage.py:104: note:     def __add__(self, str, /) -> str
+ optuna/testing/storages.py:131: error: Argument 1 to "JournalFileBackend" has incompatible type "object | Any"; expected "str"  [arg-type]
+ optuna/testing/storages.py:139: error: Argument 1 to "JournalFileBackend" has incompatible type "object | Any"; expected "str"  [arg-type]
+ tests/test_cli.py:128: error: Argument 1 to "check_call" has incompatible type "list[object]"; expected "str | bytes | PathLike[str] | PathLike[bytes] | Sequence[str | bytes | PathLike[str] | PathLike[bytes]]"  [arg-type]
+ tests/test_cli.py:131: error: Argument 1 to "check_output" has incompatible type "list[object]"; expected "str | bytes | PathLike[str] | PathLike[bytes] | Sequence[str | bytes | PathLike[str] | PathLike[bytes]]"  [arg-type]
+ tests/test_cli.py:147: error: Argument 1 to "check_output" has incompatible type "list[object]"; expected "str | bytes | PathLike[str] | PathLike[bytes] | Sequence[str | bytes | PathLike[str] | PathLike[bytes]]"  [arg-type]
+ tests/test_cli.py:172: error: Argument "env" to "check_call" has incompatible type "dict[str, object]"; expected "Mapping[bytes, str | bytes | PathLike[str] | PathLike[bytes]] | Mapping[str, str | bytes | PathLike[str] | PathLike[bytes]] | None"  [arg-type]
+ tests/test_cli.py:175: error: Argument "env" to "check_output" has incompatible type "dict[str, object]"; expected "Mapping[bytes, str | bytes | PathLike[str] | PathLike[bytes]] | Mapping[str, str | bytes | PathLike[str] | PathLike[bytes]] | None"  [arg-type]
+ tests/test_cli.py:189: error: Argument 1 to "check_output" has incompatible type "list[object]"; expected "str | bytes | PathLike[str] | PathLike[bytes] | Sequence[str | bytes | PathLike[str] | PathLike[bytes]]"  [arg-type]
+ tests/test_cli.py:194: error: Argument 1 to "check_output" has incompatible type "list[object]"; expected "str | bytes | PathLike[str] | PathLike[bytes] | Sequence[str | bytes | PathLike[str] | PathLike[bytes]]"  [arg-type]
+ tests/test_cli.py:202: error: Argument 1 to "check_call" has incompatible type "list[object]"; expected "str | bytes | PathLike[str] | PathLike[bytes] | Sequence[str | bytes | PathLike[str] | PathLike[bytes]]"  [arg-type]
+ tests/test_cli.py:219: error: Argument 1 to "check_output" has incompatible type "list[object]"; expected "str | bytes | PathLike[str] | PathLike[bytes] | Sequence[str | bytes | PathLike[str] | PathLike[bytes]]"  [arg-type]
+ tests/test_cli.py:237: error: Argument 1 to "check_call" has incompatible type "list[object]"; expected "str | bytes | PathLike[str] | PathLike[bytes] | Sequence[str | bytes | PathLike[str] | PathLike[bytes]]"  [arg-type]
+ tests/test_cli.py:254: error: Argument 1 to "check_call" has incompatible type "list[object]"; expected "str | bytes | PathLike[str] | PathLike[bytes] | Sequence[str | bytes | PathLike[str] | PathLike[bytes]]"  [arg-type]
+ tests/test_cli.py:265: error: Argument 1 to "check_call" has incompatible type "list[object]"; expected "str | bytes | PathLike[str] | PathLike[bytes] | Sequence[str | bytes | PathLike[str] | PathLike[bytes]]"  [arg-type]
+ tests/test_cli.py:270: error: Argument 1 to "check_call" has incompatible type "list[object]"; expected "str | bytes | PathLike[str] | PathLike[bytes] | Sequence[str | bytes | PathLike[str] | PathLike[bytes]]"  [arg-type]
+ tests/test_cli.py:304: error: Argument 1 to "check_call" has incompatible type "list[object]"; expected "str | bytes | PathLike[str] | PathLike[bytes] | Sequence[str | bytes | PathLike[str] | PathLike[bytes]]"  [arg-type]
+ tests/test_cli.py:331: error: Argument 1 to "check_output" has incompatible type "list[object]"; expected "str | bytes | PathLike[str] | PathLike[bytes] | Sequence[str | bytes | PathLike[str] | PathLike[bytes]]"  [arg-type]
+ tests/test_cli.py:337: error: Argument 1 to "_get_output" has incompatible type "list[object]"; expected "list[str]"  [arg-type]
+ tests/test_cli.py:352: error: Argument 1 to "check_output" has incompatible type "list[object]"; expected "str | bytes | PathLike[str] | PathLike[bytes] | Sequence[str | bytes | PathLike[str] | PathLike[bytes]]"  [arg-type]
+ tests/test_cli.py:358: error: Argument 1 to "_get_output" has incompatible type "list[object]"; expected "list[str]"  [arg-type]
+ tests/test_cli.py:388: error: Argument 1 to "_get_output" has incompatible type "list[object]"; expected "list[str]"  [arg-type]
+ tests/test_cli.py:407: error: Argument 1 to "_get_output" has incompatible type "list[object]"; expected "list[str]"  [arg-type]
+ tests/test_cli.py:455: error: Argument 1 to "_get_output" has incompatible type "list[object]"; expected "list[str]"  [arg-type]
+ tests/test_cli.py:479: error: Argument 1 to "_get_output" has incompatible type "list[object]"; expected "list[str]"  [arg-type]
+ tests/test_cli.py:566: error: Argument 1 to "_get_output" has incompatible type "list[object]"; expected "list[str]"  [arg-type]
+ tests/test_cli.py:647: error: Argument 1 to "_get_output" has incompatible type "list[object]"; expected "list[str]"  [arg-type]
+ tests/test_cli.py:722: error: Argument 1 to "_get_output" has incompatible type "list[object]"; expected "list[str]"  [arg-type]
+ tests/test_cli.py:804: error: Argument 1 to "_get_output" has incompatible type "list[object]"; expected "list[str]"  [arg-type]
+ tests/test_cli.py:878: error: Argument 1 to "_get_output" has incompatible type "list[object]"; expected "list[str]"  [arg-type]
+ tests/test_cli.py:964: error: Argument 1 to "_get_output" has incompatible type "list[object]"; expected "list[str]"  [arg-type]
+ tests/test_cli.py:1014: error: Argument 1 to "check_output" has incompatible type "list[object]"; expected "str | bytes | PathLike[str] | PathLike[bytes] | Sequence[str | bytes | PathLike[str] | PathLike[bytes]]"  [arg-type]
+ tests/test_cli.py:1023: error: Argument 1 to "check_output" has incompatible type "list[object]"; expected "str | bytes | PathLike[str] | PathLike[bytes] | Sequence[str | bytes | PathLike[str] | PathLike[bytes]]"  [arg-type]
+ tests/test_cli.py:1035: error: Argument 1 to "check_output" has incompatible type "list[object]"; expected "str | bytes | PathLike[str] | PathLike[bytes] | Sequence[str | bytes | PathLike[str] | PathLike[bytes]]"  [arg-type]
+ tests/test_cli.py:1157: error: Argument 1 to "run" has incompatible type "list[object]"; expected "str | bytes | PathLike[str] | PathLike[bytes] | Sequence[str | bytes | PathLike[str] | PathLike[bytes]]"  [arg-type]
+ tests/test_cli.py:1178: error: Argument 1 to "_get_output" has incompatible type "list[object]"; expected "list[str]"  [arg-type]
+ tests/test_cli.py:1180: error: Argument 1 to "check_output" has incompatible type "list[object]"; expected "str | bytes | PathLike[str] | PathLike[bytes] | Sequence[str | bytes | PathLike[str] | PathLike[bytes]]"  [arg-type]
+ tests/test_cli.py:1213: error: Argument 1 to "run" has incompatible type "list[object]"; expected "str | bytes | PathLike[str] | PathLike[bytes] | Sequence[str | bytes | PathLike[str] | PathLike[bytes]]"  [arg-type]
+ tests/test_cli.py:1235: error: Argument 1 to "_get_output" has incompatible type "list[object]"; expected "list[str]"  [arg-type]
+ tests/test_cli.py:1237: error: Argument 1 to "check_output" has incompatible type "list[object]"; expected "str | bytes | PathLike[str] | PathLike[bytes] | Sequence[str | bytes | PathLike[str] | PathLike[bytes]]"  [arg-type]
+ tests/test_cli.py:1260: error: Argument 1 to "run" has incompatible type "list[object]"; expected "str | bytes | PathLike[str] | PathLike[bytes] | Sequence[str | bytes | PathLike[str] | PathLike[bytes]]"  [arg-type]
+ tests/test_cli.py:1275: error: Argument 1 to "_get_output" has incompatible type "list[object]"; expected "list[str]"  [arg-type]
+ tests/test_cli.py:1277: error: Argument 1 to "check_output" has incompatible type "list[object]"; expected "str | bytes | PathLike[str] | PathLike[bytes] | Sequence[str | bytes | PathLike[str] | PathLike[bytes]]"  [arg-type]
+ tests/test_cli.py:1298: error: Argument 1 to "run" has incompatible type "list[object]"; expected "str | bytes | PathLike[str] | PathLike[bytes] | Sequence[str | bytes | PathLike[str] | PathLike[bytes]]"  [arg-type]
+ tests/test_cli.py:1314: error: Argument 1 to "_get_output" has incompatible type "list[object]"; expected "list[str]"  [arg-type]
+ tests/test_cli.py:1316: error: Argument 1 to "check_output" has incompatible type "list[object]"; expected "str | bytes | PathLike[str] | PathLike[bytes] | Sequence[str | bytes | PathLike[str] | PathLike[bytes]]"  [arg-type]
+ tests/test_cli.py:1338: error: Argument 1 to "run" has incompatible type "list[object]"; expected "str | bytes | PathLike[str] | PathLike[bytes] | Sequence[str | bytes | PathLike[str] | PathLike[bytes]]"  [arg-type]
+ tests/test_cli.py:1353: error: Argument 1 to "run" has incompatible type "list[object]"; expected "str | bytes | PathLike[str] | PathLike[bytes] | Sequence[str | bytes | PathLike[str] | PathLike[bytes]]"  [arg-type]
+ tests/test_cli.py:1377: error: Argument 1 to "run" has incompatible type "list[object]"; expected "str | bytes | PathLike[str] | PathLike[bytes] | Sequence[str | bytes | PathLike[str] | PathLike[bytes]]"  [arg-type]
+ tests/test_cli.py:1421: error: Argument 1 to "check_call" has incompatible type "list[object]"; expected "str | bytes | PathLike[str] | PathLike[bytes] | Sequence[str | bytes | PathLike[str] | PathLike[bytes]]"  [arg-type]
+ tests/test_cli.py:1439: error: Argument 1 to "_get_output" has incompatible type "list[object]"; expected "list[str]"  [arg-type]
+ tests/test_cli.py:1451: error: Argument 1 to "run" has incompatible type "list[object]"; expected "str | bytes | PathLike[str] | PathLike[bytes] | Sequence[str | bytes | PathLike[str] | PathLike[bytes]]"  [arg-type]
+ tests/test_cli.py:1458: error: List item 3 has incompatible type "object"; expected "str | bytes | PathLike[str] | PathLike[bytes]"  [list-item]
+ tests/test_cli.py:1474: error: List item 3 has incompatible type "object"; expected "str | bytes | PathLike[str] | PathLike[bytes]"  [list-item]
+ tests/test_cli.py:1483: error: Argument 1 to "JournalFileBackend" has incompatible type "object"; expected "str"  [arg-type]
+ tests/test_cli.py:1496: error: List item 3 has incompatible type "object"; expected "str | bytes | PathLike[str] | PathLike[bytes]"  [list-item]
+ tests/test_cli.py:1511: error: List item 3 has incompatible type "object"; expected "str | bytes | PathLike[str] | PathLike[bytes]"  [list-item]
+ tests/test_cli.py:1521: error: Argument 1 to "JournalFileBackend" has incompatible type "object"; expected "str"  [arg-type]
+ tests/test_cli.py:1534: error: Argument 1 to "run" has incompatible type "list[object]"; expected "str | bytes | PathLike[str] | PathLike[bytes] | Sequence[str | bytes | PathLike[str] | PathLike[bytes]]"  [arg-type]
+ tests/test_cli.py:1541: error: List item 3 has incompatible type "object"; expected "str | bytes | PathLike[str] | PathLike[bytes]"  [list-item]
+ tests/test_cli.py:1557: error: List item 3 has incompatible type "object"; expected "str | bytes | PathLike[str] | PathLike[bytes]"  [list-item]
+ tests/test_cli.py:1566: error: Argument 1 to "JournalFileBackend" has incompatible type "object"; expected "str"  [arg-type]
+ tests/test_cli.py:1590: error: Argument 1 to "run" has incompatible type "list[object]"; expected "str | bytes | PathLike[str] | PathLike[bytes] | Sequence[str | bytes | PathLike[str] | PathLike[bytes]]"  [arg-type]
+ tests/storages_tests/journal_tests/test_journal.py:56: error: Argument 1 to "JournalFileOpenLock" has incompatible type "object"; expected "str"  [arg-type]
+ tests/storages_tests/journal_tests/test_journal.py:60: error: Argument 1 to "JournalFileOpenLock" has incompatible type "object"; expected "str"  [arg-type]
+ tests/storages_tests/journal_tests/test_journal.py:64: error: Argument 1 to "JournalFileBackend" has incompatible type "object"; expected "str"  [arg-type]
+ tests/storages_tests/journal_tests/test_journal.py:129: error: Argument 1 to "JournalFileBackend" has incompatible type "object"; expected "str"  [arg-type]
+ tests/storages_tests/journal_tests/test_journal.py:155: error: Argument 1 to "JournalFileBackend" has incompatible type "object"; expected "str"  [arg-type]
+ tests/storages_tests/journal_tests/test_journal.py:175: error: Argument 1 to "JournalFileBackend" has incompatible type "object"; expected "str"  [arg-type]
+ tests/storages_tests/journal_tests/test_journal.py:186: error: Argument 2 to "submit" of "Executor" has incompatible type "object"; expected "str"  [arg-type]
+ tests/storages_tests/journal_tests/test_journal.py:272: error: Argument 1 to "JournalFileStorage" has incompatible type "object"; expected "str"  [arg-type]
+ tests/storages_tests/journal_tests/test_journal.py:320: error: Argument 1 to "JournalFileBackend" has incompatible type "object"; expected "str"  [arg-type]

spark (https://github.com/apache/spark)
+ python/pyspark/logger/worker_io.py:60: error: Incompatible return value type (got "str | bytes", expected "str")  [return-value]
+ python/pyspark/ml/dl_util.py:65: error: Incompatible return value type (got "object", expected "str")  [return-value]

pylint (https://github.com/pycqa/pylint)
+ pylint/lint/pylinter.py:96: error: Cannot instantiate abstract class "TextIOWrapper" with abstract attribute "name"  [abstract]

anyio (https://github.com/agronholm/anyio)
+ src/anyio/_core/_tempfile.py:300: error: Cannot instantiate abstract class "TextIOWrapper" with abstract attribute "name"  [abstract]
+ src/anyio/_core/_tempfile.py:300: note: Error code "abstract" not covered by "type: ignore[arg-type]" comment
+ src/anyio/streams/file.py:54: error: Argument 1 to "Path" has incompatible type "object"; expected "str | PathLike[str]"  [arg-type]

black (https://github.com/psf/black)
+ src/black/__init__.py:1207:9: error: Cannot instantiate abstract class "TextIOWrapper" with abstract attribute "name"  [abstract]
+ src/black/__init__.py:1620:10: error: Cannot instantiate abstract class "TextIOWrapper" with abstract attribute "name"  [abstract]

zope.interface (https://github.com/zopefoundation/zope.interface)
+ src/zope/interface/common/tests/test_io.py:38: error: Cannot instantiate abstract class "TextIOWrapper" with abstract attribute "name"  [abstract]

mypy (https://github.com/python/mypy)
+ mypy/dmypy_server.py:231: error: Cannot instantiate abstract class "WriteToConn" with abstract attribute "name"  [abstract]
+ mypy/dmypy_server.py:231: note: See https://mypy.rtfd.io/en/stable/_refs.html#code-abstract for more info
+ mypy/dmypy_server.py:232: error: Cannot instantiate abstract class "WriteToConn" with abstract attribute "name"  [abstract]

apprise (https://github.com/caronc/apprise)
- apprise/plugins/vapid/subscription.py:501: note:     def open(file: int | str | bytes | PathLike[str] | PathLike[bytes], mode: Literal['rb+', 'r+b', '+rb', 'br+', 'b+r', '+br', 'wb+', 'w+b', '+wb', 'bw+', 'b+w', '+bw', 'ab+', 'a+b', '+ab', 'ba+', 'b+a', '+ba', 'xb+', 'x+b', '+xb', 'bx+', 'b+x', '+bx'] | Literal['rb', 'br', 'rbU', 'rUb', 'Urb', 'brU', 'bUr', 'Ubr'] | Literal['wb', 'bw', 'ab', 'ba', 'xb', 'bx'], buffering: Literal[0], encoding: None = ..., errors: None = ..., newline: None = ..., closefd: bool = ..., opener: Callable[[str, int], int] | None = ...) -> FileIO
+ apprise/plugins/vapid/subscription.py:501: note:     def [_FileT: int | str | bytes | PathLike[str] | PathLike[bytes]] open(file: _FileT, mode: Literal['rb+', 'r+b', '+rb', 'br+', 'b+r', '+br', 'wb+', 'w+b', '+wb', 'bw+', 'b+w', '+bw', 'ab+', 'a+b', '+ab', 'ba+', 'b+a', '+ba', 'xb+', 'x+b', '+xb', 'bx+', 'b+x', '+bx'] | Literal['rb', 'br', 'rbU', 'rUb', 'Urb', 'brU', 'bUr', 'Ubr'] | Literal['wb', 'bw', 'ab', 'ba', 'xb', 'bx'], buffering: Literal[0], encoding: None = ..., errors: None = ..., newline: None = ..., closefd: bool = ..., opener: Callable[[str, int], int] | None = ...) -> FileIO[_FileT]

trio (https://github.com/python-trio/trio)
+ src/trio/_file_io.py:375: error: Missing type arguments for generic type "FileIO"  [type-arg]
+ src/trio/_path.py:163: error: Missing type arguments for generic type "FileIO"  [type-arg]
+ src/trio/_tests/type_tests/path.py:123: error: Missing type arguments for generic type "FileIO"  [type-arg]
+ src/trio/_tests/test_path.py:201: error: Invalid self argument "AsyncIOWrapper[TextIOWrapper[_WrappedBuffer]]" to attribute function "name" with type "Callable[[AsyncIOWrapper[_HasName]], str]"  [misc]

zulip (https://github.com/zulip/zulip)
+ zerver/lib/test_console_output.py:63: error: Incompatible return value type (got "object", expected "str")  [return-value]
+ zerver/lib/test_console_output.py:169: error: Cannot instantiate abstract class "TextIOWrapper" with abstract attribute "name"  [abstract]
+ zerver/lib/test_console_output.py:186: error: Cannot instantiate abstract class "TextIOWrapper" with abstract attribute "name"  [abstract]
+ zerver/tests/test_bots.py:315: error: Argument 1 to "cmp" has incompatible type "object"; expected "str | bytes | PathLike[str] | PathLike[bytes]"  [arg-type]
+ zerver/tests/test_bots.py:1659: error: Argument 1 to "cmp" has incompatible type "object"; expected "str | bytes | PathLike[str] | PathLike[bytes]"  [arg-type]

mkdocs (https://github.com/mkdocs/mkdocs)
+ mkdocs/utils/yaml.py:141: error: No overload variant of "dirname" matches argument type "object"  [call-overload]
+ mkdocs/utils/yaml.py:141: note: Possible overload variants:
+ mkdocs/utils/yaml.py:141: note:     def [AnyStr: (str, bytes)] dirname(p: PathLike[AnyStr]) -> AnyStr
+ mkdocs/utils/yaml.py:141: note:     def [AnyOrLiteralStr: (str, bytes, str)] dirname(p: AnyOrLiteralStr) -> AnyOrLiteralStr
+ mkdocs/config/base.py:308: error: List item 0 has incompatible type "object"; expected "str"  [list-item]

porcupine (https://github.com/Akuli/porcupine)
+ porcupine/_logs.py:69: error: If x = b'abc' then f"{x}" or "{}".format(x) produces "b'abc'", not "abc". If this is desired behavior, use f"{x!r}" or "{!r}".format(x). Otherwise, decode the bytes  [str-bytes-safe]

isort (https://github.com/pycqa/isort)
+ isort/io.py:45: error: Cannot instantiate abstract class "TextIOWrapper" with abstract attribute "name"  [abstract]

check-jsonschema (https://github.com/python-jsonschema/check-jsonschema)
+ src/check_jsonschema/instance_loader.py:44: error: Argument 2 to "parse_data_with_path" of "ParserSet" has incompatible type "object"; expected "Path | str"  [arg-type]
+ src/check_jsonschema/instance_loader.py:52: error: Incompatible types in "yield" (actual type "tuple[object, Any]", expected type "tuple[str, ParseError | Any]")  [misc]

git-revise (https://github.com/mystor/git-revise)
+ gitrevise/odb.py:356: error: "object" has no attribute "encode"  [attr-defined]

schemathesis (https://github.com/schemathesis/schemathesis)
+ .../projects/_schemathesis_venv/lib/python3.13/site-packages/_pytest/_io/terminalwriter.py:15: note: ... from here,
+ .../projects/_schemathesis_venv/lib/python3.13/site-packages/_pytest/_io/__init__.py:3: note: ... from here,
+ .../projects/_schemathesis_venv/lib/python3.13/site-packages/_pytest/fixtures.py:41: note: ... from here,
+ src/schemathesis/pytest/_lifecycle.py:26: note: ... from here:
+ src/schemathesis/cli/commands/_options.py: note: In function "_file_name":
+ src/schemathesis/cli/commands/_options.py:44: error: Incompatible return value type (got "object", expected "str | None")  [return-value]

pyodide (https://github.com/pyodide/pyodide)
+ src/py/pyodide/_package_loader.py:387: error: No overload variant matches argument type "object"  [call-overload]
+ src/py/pyodide/_package_loader.py:387: note: Possible overload variants:
+ src/py/pyodide/_package_loader.py:387: note:     def open(cls, name: str | bytes | PathLike[str] | PathLike[bytes] | None = ..., mode: Literal['r', 'r:*', 'r:', 'r:gz', 'r:bz2', 'r:xz'] = ..., fileobj: _Fileobj | None = ..., bufsize: int = ..., *, format: int | None = ..., tarinfo: type[TarInfo] | None = ..., dereference: bool | None = ..., ignore_zeros: bool | None = ..., encoding: str | None = ..., errors: str = ..., pax_headers: Mapping[str, str] | None = ..., debug: Literal[0, 1, 2, 3] | None = ..., errorlevel: Literal[0, 1, 2] | None = ...) -> TarFile
+ src/py/pyodide/_package_loader.py:387: note:     def open(cls, name: str | bytes | PathLike[str] | PathLike[bytes] | None, mode: Literal['r:zst'], fileobj: _Fileobj | None = ..., bufsize: int = ..., *, format: int | None = ..., tarinfo: type[TarInfo] | None = ..., dereference: bool | None = ..., ignore_zeros: bool | None = ..., encoding: str | None = ..., errors: str = ..., pax_headers: Mapping[str, str] | None = ..., debug: Literal[0, 1, 2, 3] | None = ..., errorlevel: Literal[0, 1, 2] | None = ..., level: None = ..., options: Mapping[int, int] | None = ..., zstd_dict: ZstdDict | tuple[ZstdDict, int] | None = ...) -> TarFile
+ src/py/pyodide/_package_loader.py:387: note:     def open(cls, name: str | bytes | PathLike[str] | PathLike[bytes] | None, mode: Literal['x', 'x:', 'a', 'a:', 'w', 'w:', 'w:tar'], fileobj: _Fileobj | None = ..., bufsize: int = ..., *, format: int | None = ..., tarinfo: type[TarInfo] | None = ..., dereference: bool | None = ..., ignore_zeros: bool | None = ..., encoding: str | None = ..., errors: str = ..., pax_headers: Mapping[str, str] | None = ..., debug: Literal[0, 1, 2, 3] | None = ..., errorlevel: Literal[0, 1, 2] | None = ...) -> TarFile
+ src/py/pyodide/_package_loader.py:387: note:     def open(cls, name: str | bytes | PathLike[str] | PathLike[bytes] | None = ..., *, mode: Literal['x', 'x:', 'a', 'a:', 'w', 'w:', 'w:tar'], fileobj: _Fileobj | None = ..., bufsize: int = ..., format: int | None = ..., tarinfo: type[TarInfo] | None = ..., dereference: bool | None = ..., ignore_zeros: bool | None = ..., encoding: str | None = ..., errors: str = ..., pax_headers: Mapping[str, str] | None = ..., debug: Literal[0, 1, 2, 3] | None = ..., errorlevel: Literal[0, 1, 2] | None = ...) -> TarFile
+ src/py/pyodide/_package_loader.py:387: note:     def open(cls, name: str | bytes | PathLike[str] | PathLike[bytes] | None, mode: Literal['x:gz', 'x:bz2', 'w:gz', 'w:bz2'], fileobj: _Fileobj | None = ..., bufsize: int = ..., *, format: int | None = ..., tarinfo: type[TarInfo] | None = ..., dereference: bool | None = ..., ignore_zeros: bool | None = ..., encoding: str | None = ..., errors: str = ..., pax_headers: Mapping[str, str] | None = ..., debug: Literal[0, 1, 2, 3] | None = ..., errorlevel: Literal[0, 1, 2] | None = ..., compresslevel: int = ...) -> TarFile
+ src/py/pyodide/_package_loader.py:387: note:     def open(cls, name: str | bytes | PathLike[str] | PathLike[bytes] | None = ..., *, mode: Literal['x:gz', 'x:bz2', 'w:gz', 'w:bz2'], fileobj: _Fileobj | None = ..., bufsize: int = ..., format: int | None = ..., tarinfo: type[TarInfo] | None = ..., dereference: bool | None = ..., ignore_zeros: bool | None = ..., encoding: str | None = ..., errors: str = ..., pax_headers: Mapping[str, str] | None = ..., debug: Literal[0, 1, 2, 3] | None = ..., errorlevel: Literal[0, 1, 2] | None = ..., compresslevel: int = ...) -> TarFile
+ src/py/pyodide/_package_loader.py:387: note:     def open(cls, name: str | bytes | PathLike[str] | PathLike[bytes] | None, mode: Literal['x:xz', 'w:xz'], fileobj: _Fileobj | None = ..., bufsize: int = ..., *, format: int | None = ..., tarinfo: type[TarInfo] | None = ..., dereference: bool | None = ..., ignore_zeros: bool | None = ..., encoding: str | None = ..., errors: str = ..., pax_headers: Mapping[str, str] | None = ..., debug: Literal[0, 1, 2, 3] | None = ..., errorlevel: Literal[0, 1, 2] | None = ..., preset: int | None = ...) -> TarFile
+ src/py/pyodide/_package_loader.py:387: note:     def open(cls, name: str | bytes | PathLike[str] | PathLike[bytes] | None = ..., *, mode: Literal['x:xz', 'w:xz'], fileobj: _Fileobj | None = ..., bufsize: int = ..., format: int | None = ..., tarinfo: type[TarInfo] | None = ..., dereference: bool | None = ..., ignore_zeros: bool | None = ..., encoding: str | None = ..., errors: str = ..., pax_headers: Mapping[str, str] | None = ..., debug: Literal[0, 1, 2, 3] | None = ..., errorlevel: Literal[0, 1, 2] | None = ..., preset: int | None = ...) -> TarFile
+ src/py/pyodide/_package_loader.py:387: note:     def open(cls, name: str | bytes | PathLike[str] | PathLike[bytes] | None, mode: Literal['x:zst', 'w:zst'], fileobj: _Fileobj | None = ..., bufsize: int = ..., *, format: int | None = ..., tarinfo: type[TarInfo] | None = ..., dereference: bool | None = ..., ignore_zeros: bool | None = ..., encoding: str | None = ..., errors: str = ..., pax_headers: Mapping[str, str] | None = ..., debug: Literal[0, 1, 2, 3] | None = ..., errorlevel: Literal[0, 1, 2] | None = ..., options: Mapping[int, int] | None = ..., zstd_dict: ZstdDict | tuple[ZstdDict, int] | None = ...) -> TarFile
+ src/py/pyodide/_package_loader.py:387: note:     def open(cls, name: str | bytes | PathLike[str] | PathLike[bytes] | None = ..., *, mode: Literal['x:zst', 'w:zst'], fileobj: _Fileobj | None = ..., bufsize: int = ..., format: int | None = ..., tarinfo: type[TarInfo] | None = ..., dereference: bool | None = ..., ignore_zeros: bool | None = ..., encoding: str | None = ..., errors: str = ..., pax_headers: Mapping[str, str] | None = ..., debug: Literal[0, 1, 2, 3] | None = ..., errorlevel: Literal[0, 1, 2] | None = ..., options: Mapping[int, int] | None = ..., zstd_dict: ZstdDict | tuple[ZstdDict, int] | None = ...) -> TarFile
+ src/py/pyodide/_package_loader.py:387: note:     def open(cls, name: str | bytes | PathLike[str] | PathLike[bytes] | Buffer | None, mode: Literal['r|*', 'r|', 'r|gz', 'r|bz2', 'r|xz', 'r|zst'], fileobj: _Fileobj | None = ..., bufsize: int = ..., *, format: int | None = ..., tarinfo: type[TarInfo] | None = ..., dereference: bool | None = ..., ignore_zeros: bool | None = ..., encoding: str | None = ..., errors: str = ..., pax_headers: Mapping[str, str] | None = ..., debug: Literal[0, 1, 2, 3] | None = ..., errorlevel: Literal[0, 1, 2] | None = ...) -> TarFile
+ src/py/pyodide/_package_loader.py:387: note:     def open(cls, name: str | bytes | PathLike[str] | PathLike[bytes] | Buffer | None = ..., *, mode: Literal['r|*', 'r|', 'r|gz', 'r|bz2', 'r|xz', 'r|zst'], fileobj: _Fileobj | None = ..., bufsize: int = ..., format: int | None = ..., tarinfo: type[TarInfo] | None = ..., dereference: bool | None = ..., ignore_zeros: bool | None = ..., encoding: str | None = ..., errors: str = ..., pax_headers: Mapping[str, str] | None = ..., debug: Literal[0, 1, 2, 3] | None = ..., errorlevel: Literal[0, 1, 2] | None = ...) -> TarFile
+ src/py/pyodide/_package_loader.py:387: note:     def open(cls, name: str | bytes | PathLike[str] | PathLike[bytes] | Buffer | None, mode: Literal['w|', 'w|xz', 'w|zst'], fileobj: _Fileobj | None = ..., bufsize: int = ..., *, format: int | None = ..., tarinfo: type[TarInfo] | None = ..., dereference: bool | None = ..., ignore_zeros: bool | None = ..., encoding: str | None = ..., errors: str = ..., pax_headers: Mapping[str, str] | None = ..., debug: Literal[0, 1, 2, 3] | None = ..., errorlevel: Literal[0, 1, 2] | None = ...) -> TarFile
+ src/py/pyodide/_package_loader.py:387: note:     def open(cls, name: str | bytes | PathLike[str] | PathLike[bytes] | Buffer | None = ..., *, mode: Literal['w|', 'w|xz', 'w|zst'], fileobj: _Fileobj | None = ..., bufsize: int = ..., format: int | None = ..., tarinfo: type[TarInfo] | None = ..., dereference: bool | None = ..., ignore_zeros: bool | None = ..., encoding: str | None = ..., errors: str = ..., pax_headers: Mapping[str, str] | None = ..., debug: Literal[0, 1, 2, 3] | None = ..., errorlevel: Literal[0, 1, 2] | None = ...) -> TarFile
+ src/py/pyodide/_package_loader.py:387: note:     def open(cls, name: str | bytes | PathLike[str] | PathLike[bytes] | Buffer | None, mode: Literal['w|gz', 'w|bz2'], fileobj: _Fileobj | None = ..., bufsize: int = ..., *, format: int | None = ..., tarinfo: type[TarInfo] | None = ..., dereference: bool | None = ..., ignore_zeros: bool | None = ..., encoding: str | None = ..., errors: str = ..., pax_headers: Mapping[str, str] | None = ..., debug: Literal[0, 1, 2, 3] | None = ..., errorlevel: Literal[0, 1, 2] | None = ..., compresslevel: int = ...) -> TarFile
+ src/py/pyodide/_package_loader.py:387: note:     def open(cls, name: str | bytes | PathLike[str] | PathLike[bytes] | Buffer | None = ..., *, mode: Literal['w|gz', 'w|bz2'], fileobj: _Fileobj | None = ..., bufsize: int = ..., format: int | None = ..., tarinfo: type[TarInfo] | None = ..., dereference: bool | None = ..., ignore_zeros: bool | None = ..., encoding: str | None = ..., errors: str = ..., pax_headers: Mapping[str, str] | None = ..., debug: Literal[0, 1, 2, 3] | None = ..., errorlevel: Literal[0, 1, 2] | None = ..., compresslevel: int = ...) -> TarFile

bandersnatch (https://github.com/pypa/bandersnatch)
+ .../projects/_bandersnatch_venv/lib/python3.13/site-packages/_pytest/_io/terminalwriter.py:15: note: ... from here,
+ .../projects/_bandersnatch_venv/lib/python3.13/site-packages/_pytest/_io/__init__.py:3: note: ... from here,
+ .../projects/_bandersnatch_venv/lib/python3.13/site-packages/_pytest/config/argparsing.py:24: note: ... from here,
+ .../projects/_bandersnatch_venv/lib/python3.13/site-packages/pytest/__init__.py:23: note: ... from here,
+ src/bandersnatch/tests/plugins/conftest.py:4: note: ... from here:

cwltool (https://github.com/common-workflow-language/cwltool)
+ .../projects/_cwltool_venv/lib/python3.13/site-packages/rich/syntax.py:40: note: In module imported here,
+ .../projects/_cwltool_venv/lib/python3.13/site-packages/rich/segment.py:751: note: ... from here,
+ .../projects/_cwltool_venv/lib/python3.13/site-packages/rich/table.py:23: note: ... from here,
+ cwltool/argparser.py:12: note: ... from here:
+ cwltool/cwlprov/__init__.py: note: In function "checksum_copy":
+ cwltool/cwlprov/__init__.py:152:38: error: No overload variant of "dirname" matches argument type "object"  [call-overload]
+ cwltool/cwlprov/__init__.py:152:38: note: Possible overload variants:
+ cwltool/cwlprov/__init__.py:152:38: note:     def [AnyStr: (str, bytes)] dirname(p: PathLike[AnyStr]) -> AnyStr
+ cwltool/cwlprov/__init__.py:152:38: note:     def [AnyOrLiteralStr: (str, bytes, str)] dirname(p: AnyOrLiteralStr) -> AnyOrLiteralStr
+ cwltool/cwlprov/__init__.py:154:23: error: Argument 1 to "rename" has incompatible type "object"; expected "str | bytes | PathLike[str] | PathLike[bytes]"  [arg-type]
+ cwltool/cwlprov/__init__.py:155:21: error: Argument 1 to "link" has incompatible type "object"; expected "str | bytes | PathLike[str] | PathLike[bytes]"  [arg-type]
+ cwltool/cwlprov/__init__.py:155:36: error: Argument 2 to "link" has incompatible type "object"; expected "str | bytes | PathLike[str] | PathLike[bytes]"  [arg-type]
+ cwltool/cwlprov/writablebagfile.py:36:23: error: Missing type arguments for generic type "FileIO"  [type-arg]
+ cwltool/cwlprov/writablebagfile.py: note: In function "write_bag_file":
+ cwltool/cwlprov/writablebagfile.py:121:16: error: Cannot instantiate abstract class "TextIOWrapper" with abstract attribute "name"  [abstract]
+ cwltool/main.py: note: In function "main":
+ cwltool/main.py:998:26: error: Cannot instantiate abstract class "TextIOWrapper" with abstract attribute "name"  [abstract]
+ tests/test_toolargparse.py: note: In function "test_argparse":
+ tests/test_toolargparse.py:219:33: error: Argument 1 has incompatible type "str | bytes"; expected "str"  [arg-type]
+ tests/test_pack.py: note: In function "_pack_idempotently":
+ tests/test_pack.py:164:56: error: Argument 1 to "fetch_document" has incompatible type "str | bytes"; expected "str | MutableMapping[str, CWLOutputType | None]"  [arg-type]

scikit-learn (https://github.com/scikit-learn/scikit-learn)
+ sklearn/datasets/_openml.py:211: error: Argument 1 to "move" has incompatible type "object"; expected "str | PathLike[str]"  [arg-type]

cloud-init (https://github.com/canonical/cloud-init)
+ tests/unittests/test_atomic_helper.py:38: error: Argument 1 to "chmod" has incompatible type "object"; expected "int | str | bytes | PathLike[str] | PathLike[bytes]"  [arg-type]

materialize (https://github.com/MaterializeInc/materialize)
+ misc/python/materialize/cli/scratch/create.py:116: error: If x = b'abc' then f"{x}" or "{}".format(x) produces "b'abc'", not "abc". If this is desired behavior, use f"{x!r}" or "{!r}".format(x). Otherwise, decode the bytes  [str-bytes-safe]
+ misc/python/materialize/workload_replay/util.py:289: error: Cannot instantiate abstract class "TextIOWrapper" with abstract attribute "name"  [abstract]

pandas (https://github.com/pandas-dev/pandas)
+ pandas/io/common.py:1041: error: Cannot instantiate abstract class "TextIOWrapper" with abstract attribute "name"  [abstract]

schema_salad (https://github.com/common-workflow-language/schema_salad)
+ .../projects/_schema_salad_venv/lib/python3.13/site-packages/_pytest/_io/terminalwriter.py:15: note: ... from here,
+ .../projects/_schema_salad_venv/lib/python3.13/site-packages/_pytest/_io/__init__.py:3: note: ... from here,
+ .../projects/_schema_salad_venv/lib/python3.13/site-packages/_pytest/fixtures.py:41: note: ... from here,
+ src/schema_salad/tests/test_ref_resolver.py:11: note: ... from here:
+ src/schema_salad/makedoc.py: note: In function "makedoc":
+ src/schema_salad/makedoc.py:798:35: error: Cannot instantiate abstract class "TextIOWrapper" with abstract attribute "name"  [abstract]

manticore (https://github.com/trailofbits/manticore)
+ manticore/platforms/linux.py:399: error: Incompatible return value type (got "object", expected "str")  [return-value]

xarray (https://github.com/pydata/xarray)
+ .../projects/_xarray_venv/lib/python3.13/site-packages/pygments/lexers/python.py:15: note: In module imported here,
+ .../projects/_xarray_venv/lib/python3.13/site-packages/_pytest/_io/terminalwriter.py:17: note: ... from here,
+ .../projects/_xarray_venv/lib/python3.13/site-packages/_pytest/_io/__init__.py:3: note: ... from here,
+ .../projects/_xarray_venv/lib/python3.13/site-packages/_pytest/config/argparsing.py:24: note: ... from here,
+ .../projects/_xarray_venv/lib/python3.13/site-packages/pytest/__init__.py:23: note: ... from here,
+ xarray/tests/__init__.py:12: note: ... from here:

poetry (https://github.com/python-poetry/poetry)
+ src/poetry/inspection/lazy_wheel.py:206: error: Incompatible return value type (got "object", expected "str")  [return-value]
+ tests/installation/test_wheel_installer.py:220: error: Argument 1 to "Path" has incompatible type "object"; expected "str | PathLike[str]"  [arg-type]

setuptools (https://github.com/pypa/setuptools)
+ setuptools/command/editable_wheel.py:592: error: Cannot instantiate abstract class "TextIOWrapper" with abstract attribute "name"  [abstract]

pytest (https://github.com/pytest-dev/pytest)
+ src/_pytest/capture.py:371: error: Cannot instantiate abstract class "DontReadFromInput" with abstract attribute "name"  [abstract]
+ src/_pytest/capture.py:373: error: Cannot instantiate abstract class "CaptureIO" with abstract attribute "name"  [abstract]
+ src/_pytest/capture.py:373: error: Cannot instantiate abstract class "TeeCaptureIO" with abstract attribute "name"  [abstract]
+ src/_pytest/helpconfig.py:148: error: If x = b'abc' then f"{x}" or "{}".format(x) produces "b'abc'", not "abc". If this is desired behavior, use f"{x!r}" or "{!r}".format(x). Otherwise, decode the bytes  [str-bytes-safe]
+ testing/test_capture.py:900: error: Cannot instantiate abstract class "CaptureIO" with abstract attribute "name"  [abstract]
+ testing/test_capture.py:907: error: Cannot instantiate abstract class "CaptureIO" with abstract attribute "name"  [abstract]
+ testing/test_capture.py:916: error: Cannot instantiate abstract class "CaptureIO" with abstract attribute "name"  [abstract]
+ testing/test_capture.py:924: error: Cannot instantiate abstract class "TeeCaptureIO" with abstract attribute "name"  [abstract]
+ testing/test_capture.py:935: error: Cannot instantiate abstract class "TeeCaptureIO" with abstract attribute "name"  [abstract]
+ testing/test_capture.py:944: error: Cannot instantiate abstract class "DontReadFromInput" with abstract attribute "name"  [abstract]
+ testing/test_capture.py:1092: error: No overload variant of "open" matches argument types "object", "str"  [call-overload]
+ testing/test_capture.py:1092: note: Possible overload variants:
+ testing/test_capture.py:1092: note:     def open(file: int | str | bytes | PathLike[str] | PathLike[bytes], mode: Literal['r+', '+r', 'rt+', 'r+t', '+rt', 'tr+', 't+r', '+tr', 'w+', '+w', 'wt+', 'w+t', '+wt', 'tw+', 't+w', '+tw', 'a+', '+a', 'at+', 'a+t', '+at', 'ta+', 't+a', '+ta', 'x+', '+x', 'xt+', 'x+t', '+xt', 'tx+', 't+x', '+tx'] | Literal['w', 'wt', 'tw', 'a', 'at', 'ta', 'x', 'xt', 'tx'] | Literal['r', 'rt', 'tr', 'U', 'rU', 'Ur', 'rtU', 'rUt', 'Urt', 'trU', 'tUr', 'Utr'] = ..., buffering: int = ..., encoding: str | None = ..., errors: str | None = ..., newline: str | None = ..., closefd: bool = ..., opener: Callable[[str, int], int] | None = ...) -> TextIOWrapper[_WrappedBuffer]
+ testing/test_capture.py:1092: note:     def [_FileT: int | str | bytes | PathLike[str] | PathLike[bytes]] open(file: _FileT, mode: Literal['rb+', 'r+b', '+rb', 'br+', 'b+r', '+br', 'wb+', 'w+b', '+wb', 'bw+', 'b+w', '+bw', 'ab+', 'a+b', '+ab', 'ba+', 'b+a', '+ba', 'xb+', 'x+b', '+xb', 'bx+', 'b+x', '+bx'] | Literal['rb', 'br', 'rbU', 'rUb', 'Urb', 'brU', 'bUr', 'Ubr'] | Literal['wb', 'bw', 'ab', 'ba', 'xb', 'bx'], buffering: Literal[0], encoding: None = ..., errors: None = ..., newline: None = ..., closefd: bool = ..., opener: Callable[[str, int], int] | None = ...) -> FileIO[_FileT]
+ testing/test_capture.py:1092: note:     def open(file: int | str | bytes | PathLike[str] | PathLike[bytes], mode: Literal['rb+', 'r+b', '+rb', 'br+', 'b+r', '+br', 'wb+', 'w+b', '+wb', 'bw+', 'b+w', '+bw', 'ab+', 'a+b', '+ab', 'ba+', 'b+a', '+ba', 'xb+', 'x+b', '+xb', 'bx+', 'b+x', '+bx'], buffering: Literal[-1, 1] = ..., encoding: None = ..., errors: None = ..., newline: None = ..., closefd: bool = ..., opener: Callable[[str, int], int] | None = ...) -> BufferedRandom
+ testing/test_capture.py:1092: note:     def open(file: int | str | bytes | PathLike[str] | PathLike[bytes], mode: Literal['wb', 'bw', 'ab', 'ba', 'xb', 'bx'], buffering: Literal[-1, 1] = ..., encoding: None = ..., errors: None = ..., newline: None = ..., closefd: bool = ..., opener: Callable[[str, int], int] | None = ...) -> BufferedWriter[_BufferedWriterStream]
+ testing/test_capture.py:1092: note:     def open(file: int | str | bytes | PathLike[str] | PathLike[bytes], mode: Literal['rb', 'br', 'rbU', 'rUb', 'Urb', 'brU', 'bUr', 'Ubr'], buffering: Literal[-1, 1] = ..., encoding: None = ..., errors: None = ..., newline: None = ..., closefd: bool = ..., opener: Callable[[str, int], int] | None = ...) -> BufferedReader[_BufferedReaderStream]
+ testing/test_capture.py:1092: note:     def open(file: int | str | bytes | PathLike[str] | PathLike[bytes], mode: Literal['rb+', 'r+b', '+rb', 'br+', 'b+r', '+br', 'wb+', 'w+b', '+wb', 'bw+', 'b+w', '+bw', 'ab+', 'a+b', '+ab', 'ba+', 'b+a', '+ba', 'xb+', 'x+b', '+xb', 'bx+', 'b+x', '+bx'] | Literal['rb', 'br', 'rbU', 'rUb', 'Urb', 'brU', 'bUr', 'Ubr'] | Literal['wb', 'bw', 'ab', 'ba', 'xb', 'bx'], buffering: int = ..., encoding: None = ..., errors: None = ..., newline: None = ..., closefd: bool = ..., opener: Callable[[str, int], int] | None = ...) -> BinaryIO
+ testing/test_capture.py:1092: note:     def open(file: int | str | bytes | PathLike[str] | PathLike[bytes], mode: str, buffering: int = ..., encoding: str | None = ..., errors: str | None = ..., newline: str | None = ..., closefd: bool = ..., opener: Callable[[str, int], int] | None = ...) -> IO[Any]
+ testing/test_capture.py:1210: error: Cannot instantiate abstract class "CaptureIO" with abstract attribute "name"  [abstract]
+ testing/test_capture.py:1211: error: Cannot instantiate abstract class "CaptureIO" with abstract attribute "name"  [abstract]
+ testing/io/test_terminalwriter.py:60: error: Cannot instantiate abstract class "TextIOWrapper" with abstract attribute "name"  [abstract]

openlibrary (https://github.com/internetarchive/openlibrary)
+ .../projects/_openlibrary_venv/lib/python3.13/site-packages/_pytest/_io/terminalwriter.py:15: note: ... from here,
+ .../projects/_openlibrary_venv/lib/python3.13/site-packages/_pytest/_io/__init__.py:3: note: ... from here,
+ .../projects/_openlibrary_venv/lib/python3.13/site-packages/_pytest/config/argparsing.py:24: note: ... from here,
+ .../projects/_openlibrary_venv/lib/python3.13/site-packages/pytest/__init__.py:23: note: ... from here,
+ openlibrary/admin/tests/test_numbers.py:5: note: ... from here:

rich (https://github.com/Textualize/rich)
+ rich/progress.py:227: error: Incompatible return value type (got "object", expected "str")  [return-value]
+ rich/progress.py:1371: error: Cannot instantiate abstract class "TextIOWrapper" with abstract attribute "name"  [abstract]

meson (https://github.com/mesonbuild/meson)
+ mesonbuild/mlog.py:114:20: error: Incompatible return value type (got "str | bytes", expected "str | None")  [return-value]
+ mesonbuild/mlog.py:120:20: error: Incompatible return value type (got "str | bytes", expected "str | None")  [return-value]
+ mesonbuild/minstall.py:589:30: error: If x = b'abc' then f"{x}" or "{}".format(x) produces "b'abc'", not "abc". If this is desired behavior, use f"{x!r}" or "{!r}".format(x). Otherwise, decode the bytes  [str-bytes-safe]

sphinx (https://github.com/sphinx-doc/sphinx)
+ sphinx/highlighting.py:22: note: In module imported here:

static-frame (https://github.com/static-frame/static-frame)
+ static_frame/core/www.py:177: error: Argument 1 to "Path" has incompatible type "object"; expected "str | PathLike[str]"  [arg-type]
+ static_frame/core/store_zip.py:82: error: Cannot instantiate abstract class "TextIOWrapper" with abstract attribute "name"  [abstract]

scrapy (https://github.com/scrapy/scrapy)
+ scrapy/exporters.py:250: error: Cannot instantiate abstract class "TextIOWrapper" with abstract attribute "name"  [abstract]
+ scrapy/exporters.py:321: error: Cannot instantiate abstract class "TextIOWrapper" with abstract attribute "name"  [abstract]
+ tests/test_feedexport_storages.py:284: error: Argument 1 to "Path" has incompatible type "object"; expected "str | PathLike[str]"  [arg-type]
+ tests/test_feedexport_storages.py:292: error: Argument 1 to "Path" has incompatible type "object"; expected "str | PathLike[str]"  [arg-type]

dulwich (https://github.com/dulwich/dulwich)
+ dulwich/object_store.py:3922: error: Argument 1 to "PackData" has incompatible type "object"; expected "str | PathLike[str]"  [arg-type]
+ dulwich/diff.py:651: error: Cannot instantiate abstract class "TextIOWrapper" with abstract attribute "name"  [abstract]
+ dulwich/cli.py:2867: error: Cannot instantiate abstract class "TextIOWrapper" with abstract attribute "name"  [abstract]

werkzeug (https://github.com/pallets/werkzeug)
+ src/werkzeug/utils.py:433: error: Incompatible types in assignment (expression has type "object", variable has type "PathLike[str] | str | None")  [assignment]
+ tests/test_wsgi.py:139: error: Cannot instantiate abstract class "TextIOWrapper" with abstract attribute "name"  [abstract]

urllib3 (https://github.com/urllib3/urllib3)
+ src/urllib3/util/ssltransport.py:164: error: Cannot instantiate abstract class "TextIOWrapper" with abstract attribute "name"  [abstract]
+ test/test_response.py:1387: error: Cannot instantiate abstract class "TextIOWrapper" with abstract attribute "name"  [abstract]
+ test/test_response.py:1387: note: Error code "abstract" not covered by "type: ignore[type-var]" comment
+ test/test_response.py:1401: error: Cannot instantiate abstract class "TextIOWrapper" with abstract attribute "name"  [abstract]
+ test/test_response.py:1401: note: Error code "abstract" not covered by "type: ignore[type-var]" comment
+ test/test_response.py:1408: error: Cannot instantiate abstract class "TextIOWrapper" with abstract attribute "name"  [abstract]
+ test/test_response.py:1408: note: Error code "abstract" not covered by "type: ignore[type-var]" comment

flake8 (https://github.com/pycqa/flake8)
+ src/flake8/utils.py:193: error: Cannot instantiate abstract class "TextIOWrapper" with abstract attribute "name"  [abstract]
+ tests/unit/test_utils.py:188: error: Cannot instantiate abstract class "TextIOWrapper" with abstract attribute "name"  [abstract]
+ tests/unit/test_utils.py:195: error: Cannot instantiate abstract class "TextIOWrapper" with abstract attribute "name"  [abstract]

nox (https://github.com/wntrblm/nox)
+ nox/_parallel.py:461: error: Cannot instantiate abstract class "TextIOWrapper" with abstract attribute "name"  [abstract]

@srittau

srittau commented Nov 18, 2026

Copy link
Copy Markdown
Collaborator Author

This is just a horrible mess.

@srittau srittau closed this Nov 18, 2026
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.

1 participant