typeshed icon indicating copy to clipboard operation
typeshed copied to clipboard

start fixing issue 14168 with TarFile

Open alexeev-prog opened this issue 8 months ago • 19 comments

This PR fix issue 14168 with stdlib/TarFile (name=None, fileobj=None case). This pr add overriding typing for __init__, and other methods (open and etc).

alexeev-prog avatar May 27 '25 10:05 alexeev-prog

Thanks for this!

alexeev-prog avatar May 27 '25 10:05 alexeev-prog

According to mypy_primer, this change has no effect on the checked open source code. 🤖🎉

github-actions[bot] avatar May 27 '25 11:05 github-actions[bot]

According to mypy_primer, this change has no effect on the checked open source code. 🤖🎉

github-actions[bot] avatar May 27 '25 13:05 github-actions[bot]

According to mypy_primer, this change has no effect on the checked open source code. 🤖🎉

github-actions[bot] avatar May 27 '25 13:05 github-actions[bot]

According to mypy_primer, this change has no effect on the checked open source code. 🤖🎉

github-actions[bot] avatar May 27 '25 14:05 github-actions[bot]

This is already done?

alexeev-prog avatar May 27 '25 14:05 alexeev-prog

According to mypy_primer, this change has no effect on the checked open source code. 🤖🎉

github-actions[bot] avatar May 27 '25 18:05 github-actions[bot]

All the failed tests don't seem to apply to my changes and to the TarFile. Otherwise, everything should work.

alexeev-prog avatar May 27 '25 18:05 alexeev-prog

According to mypy_primer, this change has no effect on the checked open source code. 🤖🎉

github-actions[bot] avatar May 28 '25 12:05 github-actions[bot]

This PR fix this issue

alexeev-prog avatar May 29 '25 18:05 alexeev-prog

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

pandas (https://github.com/pandas-dev/pandas)
+ pandas/io/common.py:995: note:     def open(cls, name: str | bytes | PathLike[str] | PathLike[bytes], 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: int | None = ..., errorlevel: int | None = ...) -> TarFile
+ pandas/io/common.py:995: note:     def open(cls, fileobj: _Fileobj, *, name: str | bytes | PathLike[str] | PathLike[bytes] | None = ..., mode: Literal['r', 'r:*', 'r:', 'r:gz', 'r:bz2', 'r:xz'] = ..., 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: int | None = ..., errorlevel: int | None = ...) -> TarFile
+ pandas/_testing/_io.py:141: error: No overload variant of "TarFile" matches argument types "Any", "str"  [call-overload]
+ pandas/_testing/_io.py:141: note:     def __init__(self, name: str | bytes | PathLike[str] | PathLike[bytes], mode: Literal['r', 'a', 'w', 'x'] = ..., fileobj: _Fileobj | None = ..., 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: int | None = ..., errorlevel: int | None = ..., copybufsize: int | None = ...) -> TarFile
+ pandas/_testing/_io.py:141: note:     def __init__(self, name: str | bytes | PathLike[str] | PathLike[bytes] | None = ..., mode: Literal['r', 'a', 'w', 'x'] = ..., fileobj: _Fileobj | None = ..., 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: int | None = ..., errorlevel: int | None = ..., copybufsize: int | None = ...) -> TarFile
+ pandas/_testing/_io.py:141: note:     def __init__(self, fileobj: _Fileobj, *, name: str | bytes | PathLike[str] | PathLike[bytes] | None = ..., mode: Literal['r', 'a', 'w', 'x'] = ..., 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: int | None = ..., errorlevel: int | None = ..., copybufsize: int | None = ...) -> TarFile
- pandas/_testing/_io.py:141: error: Argument "mode" to "TarFile" has incompatible type "str"; expected "Literal['r', 'a', 'w', 'x']"  [arg-type]

github-actions[bot] avatar Jun 02 '25 23:06 github-actions[bot]

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

pandas (https://github.com/pandas-dev/pandas)
+ pandas/io/common.py:995: note:     def open(cls, name: str | bytes | PathLike[str] | PathLike[bytes], 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: int | None = ..., errorlevel: int | None = ...) -> TarFile
+ pandas/io/common.py:995: note:     def open(cls, fileobj: _Fileobj, *, name: str | bytes | PathLike[str] | PathLike[bytes] | None = ..., mode: Literal['r', 'r:*', 'r:', 'r:gz', 'r:bz2', 'r:xz'] = ..., 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: int | None = ..., errorlevel: int | None = ...) -> TarFile
+ pandas/_testing/_io.py:141: error: No overload variant of "TarFile" matches argument types "Any", "str"  [call-overload]
+ pandas/_testing/_io.py:141: note:     def __init__(self, name: str | bytes | PathLike[str] | PathLike[bytes], mode: Literal['r', 'a', 'w', 'x'] = ..., fileobj: _Fileobj | None = ..., 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: int | None = ..., errorlevel: int | None = ..., copybufsize: int | None = ...) -> TarFile
+ pandas/_testing/_io.py:141: note:     def __init__(self, name: str | bytes | PathLike[str] | PathLike[bytes] | None = ..., mode: Literal['r', 'a', 'w', 'x'] = ..., fileobj: _Fileobj | None = ..., 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: int | None = ..., errorlevel: int | None = ..., copybufsize: int | None = ...) -> TarFile
+ pandas/_testing/_io.py:141: note:     def __init__(self, fileobj: _Fileobj, *, name: str | bytes | PathLike[str] | PathLike[bytes] | None = ..., mode: Literal['r', 'a', 'w', 'x'] = ..., 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: int | None = ..., errorlevel: int | None = ..., copybufsize: int | None = ...) -> TarFile
- pandas/_testing/_io.py:141: error: Argument "mode" to "TarFile" has incompatible type "str"; expected "Literal['r', 'a', 'w', 'x']"  [arg-type]

github-actions[bot] avatar Jun 04 '25 21:06 github-actions[bot]

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

pandas (https://github.com/pandas-dev/pandas)
+ pandas/io/common.py:995: note:     def open(cls, name: str | bytes | PathLike[str] | PathLike[bytes], 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: int | None = ..., errorlevel: int | None = ...) -> TarFile
+ pandas/io/common.py:995: note:     def open(cls, fileobj: _Fileobj, *, name: str | bytes | PathLike[str] | PathLike[bytes] | None = ..., mode: Literal['r', 'r:*', 'r:', 'r:gz', 'r:bz2', 'r:xz'] = ..., 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: int | None = ..., errorlevel: int | None = ...) -> TarFile
+ pandas/_testing/_io.py:141: error: No overload variant of "TarFile" matches argument types "Any", "str"  [call-overload]
+ pandas/_testing/_io.py:141: note:     def __init__(self, name: str | bytes | PathLike[str] | PathLike[bytes], mode: Literal['r', 'a', 'w', 'x'] = ..., fileobj: _Fileobj | None = ..., 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: int | None = ..., errorlevel: int | None = ..., copybufsize: int | None = ...) -> TarFile
+ pandas/_testing/_io.py:141: note:     def __init__(self, name: str | bytes | PathLike[str] | PathLike[bytes] | None = ..., mode: Literal['r', 'a', 'w', 'x'] = ..., fileobj: _Fileobj | None = ..., 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: int | None = ..., errorlevel: int | None = ..., copybufsize: int | None = ...) -> TarFile
+ pandas/_testing/_io.py:141: note:     def __init__(self, fileobj: _Fileobj, *, name: str | bytes | PathLike[str] | PathLike[bytes] | None = ..., mode: Literal['r', 'a', 'w', 'x'] = ..., 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: int | None = ..., errorlevel: int | None = ..., copybufsize: int | None = ...) -> TarFile
- pandas/_testing/_io.py:141: error: Argument "mode" to "TarFile" has incompatible type "str"; expected "Literal['r', 'a', 'w', 'x']"  [arg-type]

github-actions[bot] avatar Jun 06 '25 02:06 github-actions[bot]

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

pandas (https://github.com/pandas-dev/pandas)
+ pandas/io/common.py:995: note:     def open(cls, name: str | bytes | PathLike[str] | PathLike[bytes], 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: int | None = ..., errorlevel: int | None = ...) -> TarFile
+ pandas/io/common.py:995: note:     def open(cls, fileobj: _Fileobj, *, name: str | bytes | PathLike[str] | PathLike[bytes] | None = ..., mode: Literal['r', 'r:*', 'r:', 'r:gz', 'r:bz2', 'r:xz'] = ..., 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: int | None = ..., errorlevel: int | None = ...) -> TarFile
+ pandas/_testing/_io.py:141: error: No overload variant of "TarFile" matches argument types "Any", "str"  [call-overload]
+ pandas/_testing/_io.py:141: note:     def __init__(self, name: str | bytes | PathLike[str] | PathLike[bytes], mode: Literal['r', 'a', 'w', 'x'] = ..., fileobj: _Fileobj | None = ..., 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: int | None = ..., errorlevel: int | None = ..., copybufsize: int | None = ...) -> TarFile
+ pandas/_testing/_io.py:141: note:     def __init__(self, name: str | bytes | PathLike[str] | PathLike[bytes] | None = ..., mode: Literal['r', 'a', 'w', 'x'] = ..., fileobj: _Fileobj | None = ..., 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: int | None = ..., errorlevel: int | None = ..., copybufsize: int | None = ...) -> TarFile
+ pandas/_testing/_io.py:141: note:     def __init__(self, fileobj: _Fileobj, *, name: str | bytes | PathLike[str] | PathLike[bytes] | None = ..., mode: Literal['r', 'a', 'w', 'x'] = ..., 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: int | None = ..., errorlevel: int | None = ..., copybufsize: int | None = ...) -> TarFile
- pandas/_testing/_io.py:141: error: Argument "mode" to "TarFile" has incompatible type "str"; expected "Literal['r', 'a', 'w', 'x']"  [arg-type]

discord.py (https://github.com/Rapptz/discord.py)
- .../old_typeshed/typeshed_to_test/stdlib/typing.pyi:1014: note: "update" of "TypedDict" defined here
+ .../new_typeshed/typeshed_to_test/stdlib/typing.pyi:1014: note: "update" of "TypedDict" defined here
- .../old_typeshed/typeshed_to_test/stdlib/typing.pyi:1014: note: "update" of "TypedDict" defined here
+ .../new_typeshed/typeshed_to_test/stdlib/typing.pyi:1014: note: "update" of "TypedDict" defined here

zulip (https://github.com/zulip/zulip)
- .../old_typeshed/typeshed_to_test/stdlib/builtins.pyi:115: note: "SubTest" defined here
+ .../new_typeshed/typeshed_to_test/stdlib/builtins.pyi:115: note: "SubTest" defined here
- .../old_typeshed/typeshed_to_test/stdlib/builtins.pyi:115: note: "SubTest" defined here
+ .../new_typeshed/typeshed_to_test/stdlib/builtins.pyi:115: note: "SubTest" defined here
- .../old_typeshed/typeshed_to_test/stdlib/builtins.pyi:115: note: "SubTest" defined here
+ .../new_typeshed/typeshed_to_test/stdlib/builtins.pyi:115: note: "SubTest" defined here
- .../old_typeshed/typeshed_to_test/stdlib/builtins.pyi:115: note: "SubTest" defined here
+ .../new_typeshed/typeshed_to_test/stdlib/builtins.pyi:115: note: "SubTest" defined here
- .../old_typeshed/typeshed_to_test/stdlib/builtins.pyi:115: note: "SubTest" defined here
+ .../new_typeshed/typeshed_to_test/stdlib/builtins.pyi:115: note: "SubTest" defined here
- .../old_typeshed/typeshed_to_test/stdlib/builtins.pyi:115: note: "SubTest" defined here
+ .../new_typeshed/typeshed_to_test/stdlib/builtins.pyi:115: note: "SubTest" defined here
- .../old_typeshed/typeshed_to_test/stdlib/builtins.pyi:115: note: "SubTest" defined here
+ .../new_typeshed/typeshed_to_test/stdlib/builtins.pyi:115: note: "SubTest" defined here
- .../old_typeshed/typeshed_to_test/stdlib/builtins.pyi:115: note: "SubTest" defined here
+ .../new_typeshed/typeshed_to_test/stdlib/builtins.pyi:115: note: "SubTest" defined here
- .../old_typeshed/typeshed_to_test/stdlib/builtins.pyi:115: note: "SubTest" defined here
+ .../new_typeshed/typeshed_to_test/stdlib/builtins.pyi:115: note: "SubTest" defined here
- .../old_typeshed/typeshed_to_test/stdlib/builtins.pyi:115: note: "SubTest" defined here
+ .../new_typeshed/typeshed_to_test/stdlib/builtins.pyi:115: note: "SubTest" defined here
- .../old_typeshed/typeshed_to_test/stdlib/builtins.pyi:115: note: "SubTest" defined here
+ .../new_typeshed/typeshed_to_test/stdlib/builtins.pyi:115: note: "SubTest" defined here
- .../old_typeshed/typeshed_to_test/stdlib/builtins.pyi:115: note: "SubTest" defined here
+ .../new_typeshed/typeshed_to_test/stdlib/builtins.pyi:115: note: "SubTest" defined here
- .../old_typeshed/typeshed_to_test/stdlib/builtins.pyi:115: note: "SubTest" defined here
+ .../new_typeshed/typeshed_to_test/stdlib/builtins.pyi:115: note: "SubTest" defined here
- .../old_typeshed/typeshed_to_test/stdlib/builtins.pyi:115: note: "SubTest" defined here
+ .../new_typeshed/typeshed_to_test/stdlib/builtins.pyi:115: note: "SubTest" defined here
- .../old_typeshed/typeshed_to_test/stdlib/builtins.pyi:115: note: "SubTest" defined here
+ .../new_typeshed/typeshed_to_test/stdlib/builtins.pyi:115: note: "SubTest" defined here
- .../old_typeshed/typeshed_to_test/stdlib/builtins.pyi:115: note: "SubTest" defined here
+ .../new_typeshed/typeshed_to_test/stdlib/builtins.pyi:115: note: "SubTest" defined here

strawberry (https://github.com/strawberry-graphql/strawberry)
- .../old_typeshed/typeshed_to_test/stdlib/builtins.pyi:137: note: "__init_subclass__" of "object" defined here
+ .../new_typeshed/typeshed_to_test/stdlib/builtins.pyi:137: note: "__init_subclass__" of "object" defined here

prefect (https://github.com/PrefectHQ/prefect)
- .../old_typeshed/typeshed_to_test/stdlib/inspect.pyi:332: note: "signature" defined here
+ .../new_typeshed/typeshed_to_test/stdlib/inspect.pyi:332: note: "signature" defined here
- .../old_typeshed/typeshed_to_test/stdlib/builtins.pyi:137: note: "__init_subclass__" of "object" defined here
+ .../new_typeshed/typeshed_to_test/stdlib/builtins.pyi:137: note: "__init_subclass__" of "object" defined here
- .../old_typeshed/typeshed_to_test/stdlib/builtins.pyi:137: note: "__init_subclass__" of "object" defined here
+ .../new_typeshed/typeshed_to_test/stdlib/builtins.pyi:137: note: "__init_subclass__" of "object" defined here
- .../old_typeshed/typeshed_to_test/stdlib/builtins.pyi:137: note: "__init_subclass__" of "object" defined here
+ .../new_typeshed/typeshed_to_test/stdlib/builtins.pyi:137: note: "__init_subclass__" of "object" defined here
- .../old_typeshed/typeshed_to_test/stdlib/builtins.pyi:137: note: "__init_subclass__" of "object" defined here
+ .../new_typeshed/typeshed_to_test/stdlib/builtins.pyi:137: note: "__init_subclass__" of "object" defined here
- .../old_typeshed/typeshed_to_test/stdlib/builtins.pyi:137: note: "__init_subclass__" of "object" defined here
+ .../new_typeshed/typeshed_to_test/stdlib/builtins.pyi:137: note: "__init_subclass__" of "object" defined here
- .../old_typeshed/typeshed_to_test/stdlib/builtins.pyi:137: note: "__init_subclass__" of "object" defined here
+ .../new_typeshed/typeshed_to_test/stdlib/builtins.pyi:137: note: "__init_subclass__" of "object" defined here
- .../old_typeshed/typeshed_to_test/stdlib/builtins.pyi:137: note: "__init_subclass__" of "object" defined here
+ .../new_typeshed/typeshed_to_test/stdlib/builtins.pyi:137: note: "__init_subclass__" of "object" defined here
- .../old_typeshed/typeshed_to_test/stdlib/builtins.pyi:137: note: "__init_subclass__" of "object" defined here
+ .../new_typeshed/typeshed_to_test/stdlib/builtins.pyi:137: note: "__init_subclass__" of "object" defined here
- .../old_typeshed/typeshed_to_test/stdlib/builtins.pyi:137: note: "__init_subclass__" of "object" defined here
+ .../new_typeshed/typeshed_to_test/stdlib/builtins.pyi:137: note: "__init_subclass__" of "object" defined here

ibis (https://github.com/ibis-project/ibis)
- .../old_typeshed/typeshed_to_test/stdlib/builtins.pyi:115: note: "Any" defined here
+ .../new_typeshed/typeshed_to_test/stdlib/builtins.pyi:115: note: "Any" defined here
- .../old_typeshed/typeshed_to_test/stdlib/builtins.pyi:115: note: "__init__" of "object" defined here
+ .../new_typeshed/typeshed_to_test/stdlib/builtins.pyi:115: note: "__init__" of "object" defined here
- .../old_typeshed/typeshed_to_test/stdlib/builtins.pyi:115: note: "__init__" of "object" defined here
+ .../new_typeshed/typeshed_to_test/stdlib/builtins.pyi:115: note: "__init__" of "object" defined here
- .../old_typeshed/typeshed_to_test/stdlib/builtins.pyi:115: note: "__init__" of "object" defined here
+ .../new_typeshed/typeshed_to_test/stdlib/builtins.pyi:115: note: "__init__" of "object" defined here

github-actions[bot] avatar Jun 09 '25 14:06 github-actions[bot]

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

pandas (https://github.com/pandas-dev/pandas)
+ pandas/io/common.py:995: note:     def open(cls, name: str | bytes | PathLike[str] | PathLike[bytes], 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: int | None = ..., errorlevel: int | None = ...) -> TarFile
+ pandas/io/common.py:995: note:     def open(cls, fileobj: _Fileobj, *, name: str | bytes | PathLike[str] | PathLike[bytes] | None = ..., mode: Literal['r', 'r:*', 'r:', 'r:gz', 'r:bz2', 'r:xz'] = ..., 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: int | None = ..., errorlevel: int | None = ...) -> TarFile
+ pandas/_testing/_io.py:141: error: No overload variant of "TarFile" matches argument types "Any", "str"  [call-overload]
+ pandas/_testing/_io.py:141: note:     def __init__(self, name: str | bytes | PathLike[str] | PathLike[bytes], mode: Literal['r', 'a', 'w', 'x'] = ..., fileobj: _Fileobj | None = ..., 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: int | None = ..., errorlevel: int | None = ..., copybufsize: int | None = ...) -> TarFile
+ pandas/_testing/_io.py:141: note:     def __init__(self, name: str | bytes | PathLike[str] | PathLike[bytes] | None = ..., mode: Literal['r', 'a', 'w', 'x'] = ..., fileobj: _Fileobj | None = ..., 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: int | None = ..., errorlevel: int | None = ..., copybufsize: int | None = ...) -> TarFile
+ pandas/_testing/_io.py:141: note:     def __init__(self, fileobj: _Fileobj, *, name: str | bytes | PathLike[str] | PathLike[bytes] | None = ..., mode: Literal['r', 'a', 'w', 'x'] = ..., 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: int | None = ..., errorlevel: int | None = ..., copybufsize: int | None = ...) -> TarFile
- pandas/_testing/_io.py:141: error: Argument "mode" to "TarFile" has incompatible type "str"; expected "Literal['r', 'a', 'w', 'x']"  [arg-type]

github-actions[bot] avatar Jun 11 '25 20:06 github-actions[bot]

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

pandas (https://github.com/pandas-dev/pandas)
+ pandas/io/common.py:995: note:     def open(cls, name: str | bytes | PathLike[str] | PathLike[bytes], 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: int | None = ..., errorlevel: int | None = ...) -> TarFile
+ pandas/io/common.py:995: note:     def open(cls, fileobj: _Fileobj, *, name: str | bytes | PathLike[str] | PathLike[bytes] | None = ..., mode: Literal['r', 'r:*', 'r:', 'r:gz', 'r:bz2', 'r:xz'] = ..., 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: int | None = ..., errorlevel: int | None = ...) -> TarFile
+ pandas/_testing/_io.py:141: error: No overload variant of "TarFile" matches argument types "Any", "str"  [call-overload]
+ pandas/_testing/_io.py:141: note:     def __init__(self, name: str | bytes | PathLike[str] | PathLike[bytes], mode: Literal['r', 'a', 'w', 'x'] = ..., fileobj: _Fileobj | None = ..., 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: int | None = ..., errorlevel: int | None = ..., copybufsize: int | None = ...) -> TarFile
+ pandas/_testing/_io.py:141: note:     def __init__(self, name: str | bytes | PathLike[str] | PathLike[bytes] | None = ..., mode: Literal['r', 'a', 'w', 'x'] = ..., fileobj: _Fileobj | None = ..., 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: int | None = ..., errorlevel: int | None = ..., copybufsize: int | None = ...) -> TarFile
+ pandas/_testing/_io.py:141: note:     def __init__(self, fileobj: _Fileobj, *, name: str | bytes | PathLike[str] | PathLike[bytes] | None = ..., mode: Literal['r', 'a', 'w', 'x'] = ..., 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: int | None = ..., errorlevel: int | None = ..., copybufsize: int | None = ...) -> TarFile
- pandas/_testing/_io.py:141: error: Argument "mode" to "TarFile" has incompatible type "str"; expected "Literal['r', 'a', 'w', 'x']"  [arg-type]

github-actions[bot] avatar Jun 12 '25 18:06 github-actions[bot]

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

pandas (https://github.com/pandas-dev/pandas)
+ pandas/io/common.py:995: note:     def open(cls, name: str | bytes | PathLike[str] | PathLike[bytes], 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: int | None = ..., errorlevel: int | None = ...) -> TarFile
+ pandas/io/common.py:995: note:     def open(cls, fileobj: _Fileobj, *, name: str | bytes | PathLike[str] | PathLike[bytes] | None = ..., mode: Literal['r', 'r:*', 'r:', 'r:gz', 'r:bz2', 'r:xz'] = ..., 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: int | None = ..., errorlevel: int | None = ...) -> TarFile
+ pandas/_testing/_io.py:141: error: No overload variant of "TarFile" matches argument types "Any", "str"  [call-overload]
+ pandas/_testing/_io.py:141: note:     def __init__(self, name: str | bytes | PathLike[str] | PathLike[bytes], mode: Literal['r', 'a', 'w', 'x'] = ..., fileobj: _Fileobj | None = ..., 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: int | None = ..., errorlevel: int | None = ..., copybufsize: int | None = ...) -> TarFile
+ pandas/_testing/_io.py:141: note:     def __init__(self, name: str | bytes | PathLike[str] | PathLike[bytes] | None = ..., mode: Literal['r', 'a', 'w', 'x'] = ..., fileobj: _Fileobj | None = ..., 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: int | None = ..., errorlevel: int | None = ..., copybufsize: int | None = ...) -> TarFile
+ pandas/_testing/_io.py:141: note:     def __init__(self, fileobj: _Fileobj, *, name: str | bytes | PathLike[str] | PathLike[bytes] | None = ..., mode: Literal['r', 'a', 'w', 'x'] = ..., 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: int | None = ..., errorlevel: int | None = ..., copybufsize: int | None = ...) -> TarFile
- pandas/_testing/_io.py:141: error: Argument "mode" to "TarFile" has incompatible type "str"; expected "Literal['r', 'a', 'w', 'x']"  [arg-type]

github-actions[bot] avatar Jun 13 '25 09:06 github-actions[bot]

@alexeev-prog just a passing note: there's no need to merge main so often (certainly not daily). Doing so is noisy to watchers and wasteful of CI resources. Generally merging main is only useful if there's a conflict or if enough time has passed that the CI might have meaningfully changed. (a maintainer will review your PR as soon as they are able :wink:)

brianschubert avatar Jun 13 '25 14:06 brianschubert

Thanks for the review! I'll apply it today or tomorrow. Apologies for the merge main.

alexeev-prog avatar Jun 13 '25 17:06 alexeev-prog

If it helps, you can run stubtest locally with the command

python -m mypy.stubtest --check-typeshed --show-traceback --custom-typeshed-dir . --allowlist stdlib/@tests/stubtest_allowlists/common.txt --allowlist stdlib/@tests/stubtest_allowlists/linux.txt --allowlist stdlib/@tests/stubtest_allowlists/py314.txt

(replace linux.txt and py314.txt with appropriate values for you environment)

You can also run pre-commit run -a locally to apply the code formatter.

Thanks for working on this!

brianschubert avatar Jul 04 '25 20:07 brianschubert

If it helps, you can run stubtest locally with the command

python -m mypy.stubtest --check-typeshed --show-traceback --custom-typeshed-dir . --allowlist stdlib/@tests/stubtest_allowlists/common.txt --allowlist stdlib/@tests/stubtest_allowlists/linux.txt --allowlist stdlib/@tests/stubtest_allowlists/py314.txt

(replace linux.txt and py314.txt with appropriate values for you environment)

You can also run pre-commit run -a locally to apply the code formatter.

Thanks for working on this!

Thanks!

alexeev-prog avatar Jul 04 '25 20:07 alexeev-prog

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

pandas (https://github.com/pandas-dev/pandas)
- pandas/io/common.py:995: 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: int | None = ..., errorlevel: int | None = ...) -> TarFile
+ pandas/io/common.py:995: note:     def open(cls, name: str | bytes | PathLike[str] | PathLike[bytes], 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: int | None = ..., errorlevel: int | None = ...) -> TarFile
+ pandas/io/common.py:995: note:     def open(cls, fileobj: _Fileobj, *, name: str | bytes | PathLike[str] | PathLike[bytes] | None = ..., mode: Literal['r', 'r:*', 'r:', 'r:gz', 'r:bz2', 'r:xz'] = ..., 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: int | None = ..., errorlevel: int | None = ...) -> TarFile
+ pandas/io/common.py:995: note:     def open(cls, *, fileobj: _Fileobj, name: str | bytes | PathLike[str] | PathLike[bytes] | None = ..., mode: Literal['r', 'r:*', 'r:', 'r:gz', 'r:bz2', 'r:xz'] = ..., 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: int | None = ..., errorlevel: int | None = ...) -> TarFile
- pandas/io/common.py:995: 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: int | None = ..., errorlevel: int | None = ...) -> TarFile
+ pandas/io/common.py:995: note:     def open(cls, name: str | bytes | PathLike[str] | PathLike[bytes], 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: int | None = ..., errorlevel: int | None = ...) -> TarFile
- pandas/io/common.py:995: 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: int | None = ..., errorlevel: int | None = ...) -> TarFile
+ pandas/io/common.py:995: note:     def open(cls, fileobj: _Fileobj, *, name: str | bytes | PathLike[str] | PathLike[bytes] | None = ..., mode: Literal['x', 'x:', 'a', 'a:', 'w', 'w:', 'w:tar'], 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: int | None = ..., errorlevel: int | None = ...) -> TarFile
+ pandas/io/common.py:995: note:     def open(cls, *, fileobj: _Fileobj, name: str | bytes | PathLike[str] | PathLike[bytes] | None = ..., mode: Literal['x', 'x:', 'a', 'a:', 'w', 'w:', 'w:tar'], 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: int | None = ..., errorlevel: int | None = ...) -> TarFile
- pandas/io/common.py:995: 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: int | None = ..., errorlevel: int | None = ..., compresslevel: int = ...) -> TarFile
+ pandas/io/common.py:995: note:     def open(cls, name: str | bytes | PathLike[str] | PathLike[bytes], 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: int | None = ..., errorlevel: int | None = ..., compresslevel: int = ...) -> TarFile
- pandas/io/common.py:995: 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: int | None = ..., errorlevel: int | None = ..., compresslevel: int = ...) -> TarFile
+ pandas/io/common.py:995: note:     def open(cls, fileobj: _Fileobj, *, name: str | bytes | PathLike[str] | PathLike[bytes] | None = ..., mode: Literal['x:gz', 'x:bz2', 'w:gz', 'w:bz2'], 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: int | None = ..., errorlevel: int | None = ..., compresslevel: int = ...) -> TarFile
+ pandas/io/common.py:995: note:     def open(cls, *, fileobj: _Fileobj, name: str | bytes | PathLike[str] | PathLike[bytes] | None = ..., mode: Literal['x:gz', 'x:bz2', 'w:gz', 'w:bz2'], 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: int | None = ..., errorlevel: int | None = ..., compresslevel: int = ...) -> TarFile
- pandas/io/common.py:995: 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: int | None = ..., errorlevel: int | None = ..., preset: Literal[0, 1, 2, 3, 4, 5, 6, 7, 8, 9] | None = ...) -> TarFile
+ pandas/io/common.py:995: note:     def open(cls, name: str | bytes | PathLike[str] | PathLike[bytes], 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: int | None = ..., errorlevel: int | None = ..., preset: Literal[0, 1, 2, 3, 4, 5, 6, 7, 8, 9] | None = ...) -> TarFile
- pandas/io/common.py:995: 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: int | None = ..., errorlevel: int | None = ..., preset: Literal[0, 1, 2, 3, 4, 5, 6, 7, 8, 9] | None = ...) -> TarFile
+ pandas/io/common.py:995: note:     def open(cls, fileobj: _Fileobj, *, name: str | bytes | PathLike[str] | PathLike[bytes] | None = ..., mode: Literal['x:xz', 'w:xz'], 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: int | None = ..., errorlevel: int | None = ..., preset: Literal[0, 1, 2, 3, 4, 5, 6, 7, 8, 9] | None = ...) -> TarFile
+ pandas/io/common.py:995: note:     def open(cls, *, fileobj: _Fileobj, name: str | bytes | PathLike[str] | PathLike[bytes] | None = ..., mode: Literal['x:xz', 'w:xz'], 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: int | None = ..., errorlevel: int | None = ..., preset: Literal[0, 1, 2, 3, 4, 5, 6, 7, 8, 9] | None = ...) -> TarFile
- pandas/io/common.py:995: note:     def open(cls, name: str | bytes | PathLike[str] | PathLike[bytes] | Buffer | None, mode: Literal['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: int | None = ..., errorlevel: int | None = ...) -> TarFile
+ pandas/io/common.py:995: note:     def open(cls, name: str | bytes | PathLike[str] | PathLike[bytes] | Buffer, mode: Literal['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: int | None = ..., errorlevel: int | None = ...) -> TarFile
- pandas/io/common.py:995: note:     def open(cls, name: str | bytes | PathLike[str] | PathLike[bytes] | Buffer | None = ..., *, mode: Literal['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: int | None = ..., errorlevel: int | None = ...) -> TarFile
+ pandas/io/common.py:995: note:     def open(cls, fileobj: _Fileobj, *, name: str | bytes | PathLike[str] | PathLike[bytes] | Buffer | None = ..., mode: Literal['r|*', 'r|', 'r|gz', 'r|bz2', 'r|xz'], 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: int | None = ..., errorlevel: int | None = ...) -> TarFile
+ pandas/io/common.py:995: note:     def open(cls, *, fileobj: _Fileobj, name: str | bytes | PathLike[str] | PathLike[bytes] | Buffer | None = ..., mode: Literal['r|*', 'r|', 'r|gz', 'r|bz2', 'r|xz'], 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: int | None = ..., errorlevel: int | None = ...) -> TarFile
- pandas/io/common.py:995: note:     def open(cls, name: str | bytes | PathLike[str] | PathLike[bytes] | Buffer | None, mode: Literal['w|', '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: int | None = ..., errorlevel: int | None = ...) -> TarFile
+ pandas/io/common.py:995: note:     def open(cls, name: str | bytes | PathLike[str] | PathLike[bytes] | Buffer, mode: Literal['w|', '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: int | None = ..., errorlevel: int | None = ...) -> TarFile
- pandas/io/common.py:995: note:     def open(cls, name: str | bytes | PathLike[str] | PathLike[bytes] | Buffer | None = ..., *, mode: Literal['w|', '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: int | None = ..., errorlevel: int | None = ...) -> TarFile
+ pandas/io/common.py:995: note:     def open(cls, fileobj: _Fileobj, *, name: str | bytes | PathLike[str] | PathLike[bytes] | Buffer | None = ..., mode: Literal['w|', 'w|xz'], 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: int | None = ..., errorlevel: int | None = ...) -> TarFile
+ pandas/io/common.py:995: note:     def open(cls, *, fileobj: _Fileobj, name: str | bytes | PathLike[str] | PathLike[bytes] | Buffer | None = ..., mode: Literal['w|', 'w|xz'], 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: int | None = ..., errorlevel: int | None = ...) -> TarFile
- pandas/io/common.py:995: 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: int | None = ..., errorlevel: int | None = ..., compresslevel: int = ...) -> TarFile
+ pandas/io/common.py:995: note:     def open(cls, name: str | bytes | PathLike[str] | PathLike[bytes] | Buffer, 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: int | None = ..., errorlevel: int | None = ..., compresslevel: int = ...) -> TarFile
- pandas/io/common.py:995: 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: int | None = ..., errorlevel: int | None = ..., compresslevel: int = ...) -> TarFile
+ pandas/io/common.py:995: note:     def open(cls, fileobj: _Fileobj, *, name: str | bytes | PathLike[str] | PathLike[bytes] | Buffer | None = ..., mode: Literal['w|gz', 'w|bz2'], 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: int | None = ..., errorlevel: int | None = ..., compresslevel: int = ...) -> TarFile
+ pandas/io/common.py:995: note:     def open(cls, *, fileobj: _Fileobj, name: str | bytes | PathLike[str] | PathLike[bytes] | Buffer | None = ..., mode: Literal['w|gz', 'w|bz2'], 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: int | None = ..., errorlevel: int | None = ..., compresslevel: int = ...) -> TarFile
+ pandas/_testing/_io.py:141: error: No overload variant of "TarFile" matches argument types "Any", "str"  [call-overload]
+ pandas/_testing/_io.py:141: note:     def __init__(self, name: str | bytes | PathLike[str] | PathLike[bytes], mode: Literal['r', 'a', 'w', 'x'] = ..., fileobj: _Fileobj | None = ..., 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: int | None = ..., errorlevel: int | None = ..., copybufsize: int | None = ...) -> TarFile
+ pandas/_testing/_io.py:141: note:     def __init__(self, fileobj: _Fileobj, *, name: str | bytes | PathLike[str] | PathLike[bytes] | None = ..., mode: Literal['r', 'a', 'w', 'x'] = ..., 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: int | None = ..., errorlevel: int | None = ..., copybufsize: int | None = ...) -> TarFile
- pandas/_testing/_io.py:141: error: Argument "mode" to "TarFile" has incompatible type "str"; expected "Literal['r', 'a', 'w', 'x']"  [arg-type]

github-actions[bot] avatar Jul 04 '25 20:07 github-actions[bot]

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

pandas (https://github.com/pandas-dev/pandas)
- pandas/io/common.py:995: 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: int | None = ..., errorlevel: int | None = ...) -> TarFile
+ pandas/io/common.py:995: note:     def open(cls, name: str | bytes | PathLike[str] | PathLike[bytes], 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: int | None = ..., errorlevel: int | None = ...) -> TarFile
+ pandas/io/common.py:995: note:     def open(cls, fileobj: _Fileobj, *, name: str | bytes | PathLike[str] | PathLike[bytes] | None = ..., mode: Literal['r', 'r:*', 'r:', 'r:gz', 'r:bz2', 'r:xz'] = ..., 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: int | None = ..., errorlevel: int | None = ...) -> TarFile
+ pandas/io/common.py:995: note:     def open(cls, *, fileobj: _Fileobj, name: str | bytes | PathLike[str] | PathLike[bytes] | None = ..., mode: Literal['r', 'r:*', 'r:', 'r:gz', 'r:bz2', 'r:xz'] = ..., 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: int | None = ..., errorlevel: int | None = ...) -> TarFile
- pandas/io/common.py:995: 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: int | None = ..., errorlevel: int | None = ...) -> TarFile
+ pandas/io/common.py:995: note:     def open(cls, name: str | bytes | PathLike[str] | PathLike[bytes], 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: int | None = ..., errorlevel: int | None = ...) -> TarFile
- pandas/io/common.py:995: 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: int | None = ..., errorlevel: int | None = ...) -> TarFile
+ pandas/io/common.py:995: note:     def open(cls, fileobj: _Fileobj, *, name: str | bytes | PathLike[str] | PathLike[bytes] | None = ..., mode: Literal['x', 'x:', 'a', 'a:', 'w', 'w:', 'w:tar'], 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: int | None = ..., errorlevel: int | None = ...) -> TarFile
+ pandas/io/common.py:995: note:     def open(cls, *, fileobj: _Fileobj, name: str | bytes | PathLike[str] | PathLike[bytes] | None = ..., mode: Literal['x', 'x:', 'a', 'a:', 'w', 'w:', 'w:tar'], 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: int | None = ..., errorlevel: int | None = ...) -> TarFile
- pandas/io/common.py:995: 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: int | None = ..., errorlevel: int | None = ..., compresslevel: int = ...) -> TarFile
+ pandas/io/common.py:995: note:     def open(cls, name: str | bytes | PathLike[str] | PathLike[bytes], 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: int | None = ..., errorlevel: int | None = ..., compresslevel: int = ...) -> TarFile
- pandas/io/common.py:995: 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: int | None = ..., errorlevel: int | None = ..., compresslevel: int = ...) -> TarFile
+ pandas/io/common.py:995: note:     def open(cls, fileobj: _Fileobj, *, name: str | bytes | PathLike[str] | PathLike[bytes] | None = ..., mode: Literal['x:gz', 'x:bz2', 'w:gz', 'w:bz2'], 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: int | None = ..., errorlevel: int | None = ..., compresslevel: int = ...) -> TarFile
+ pandas/io/common.py:995: note:     def open(cls, *, fileobj: _Fileobj, name: str | bytes | PathLike[str] | PathLike[bytes] | None = ..., mode: Literal['x:gz', 'x:bz2', 'w:gz', 'w:bz2'], 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: int | None = ..., errorlevel: int | None = ..., compresslevel: int = ...) -> TarFile
- pandas/io/common.py:995: 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: int | None = ..., errorlevel: int | None = ..., preset: Literal[0, 1, 2, 3, 4, 5, 6, 7, 8, 9] | None = ...) -> TarFile
+ pandas/io/common.py:995: note:     def open(cls, name: str | bytes | PathLike[str] | PathLike[bytes], 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: int | None = ..., errorlevel: int | None = ..., preset: Literal[0, 1, 2, 3, 4, 5, 6, 7, 8, 9] | None = ...) -> TarFile
- pandas/io/common.py:995: 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: int | None = ..., errorlevel: int | None = ..., preset: Literal[0, 1, 2, 3, 4, 5, 6, 7, 8, 9] | None = ...) -> TarFile
+ pandas/io/common.py:995: note:     def open(cls, fileobj: _Fileobj, *, name: str | bytes | PathLike[str] | PathLike[bytes] | None = ..., mode: Literal['x:xz', 'w:xz'], 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: int | None = ..., errorlevel: int | None = ..., preset: Literal[0, 1, 2, 3, 4, 5, 6, 7, 8, 9] | None = ...) -> TarFile
+ pandas/io/common.py:995: note:     def open(cls, *, fileobj: _Fileobj, name: str | bytes | PathLike[str] | PathLike[bytes] | None = ..., mode: Literal['x:xz', 'w:xz'], 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: int | None = ..., errorlevel: int | None = ..., preset: Literal[0, 1, 2, 3, 4, 5, 6, 7, 8, 9] | None = ...) -> TarFile
- pandas/io/common.py:995: note:     def open(cls, name: str | bytes | PathLike[str] | PathLike[bytes] | Buffer | None, mode: Literal['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: int | None = ..., errorlevel: int | None = ...) -> TarFile
+ pandas/io/common.py:995: note:     def open(cls, name: str | bytes | PathLike[str] | PathLike[bytes] | Buffer, mode: Literal['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: int | None = ..., errorlevel: int | None = ...) -> TarFile
- pandas/io/common.py:995: note:     def open(cls, name: str | bytes | PathLike[str] | PathLike[bytes] | Buffer | None = ..., *, mode: Literal['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: int | None = ..., errorlevel: int | None = ...) -> TarFile
+ pandas/io/common.py:995: note:     def open(cls, fileobj: _Fileobj, *, name: str | bytes | PathLike[str] | PathLike[bytes] | Buffer | None = ..., mode: Literal['r|*', 'r|', 'r|gz', 'r|bz2', 'r|xz'], 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: int | None = ..., errorlevel: int | None = ...) -> TarFile
+ pandas/io/common.py:995: note:     def open(cls, *, fileobj: _Fileobj, name: str | bytes | PathLike[str] | PathLike[bytes] | Buffer | None = ..., mode: Literal['r|*', 'r|', 'r|gz', 'r|bz2', 'r|xz'], 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: int | None = ..., errorlevel: int | None = ...) -> TarFile
- pandas/io/common.py:995: note:     def open(cls, name: str | bytes | PathLike[str] | PathLike[bytes] | Buffer | None, mode: Literal['w|', '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: int | None = ..., errorlevel: int | None = ...) -> TarFile
+ pandas/io/common.py:995: note:     def open(cls, name: str | bytes | PathLike[str] | PathLike[bytes] | Buffer, mode: Literal['w|', '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: int | None = ..., errorlevel: int | None = ...) -> TarFile
- pandas/io/common.py:995: note:     def open(cls, name: str | bytes | PathLike[str] | PathLike[bytes] | Buffer | None = ..., *, mode: Literal['w|', '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: int | None = ..., errorlevel: int | None = ...) -> TarFile
+ pandas/io/common.py:995: note:     def open(cls, fileobj: _Fileobj, *, name: str | bytes | PathLike[str] | PathLike[bytes] | Buffer | None = ..., mode: Literal['w|', 'w|xz'], 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: int | None = ..., errorlevel: int | None = ...) -> TarFile
+ pandas/io/common.py:995: note:     def open(cls, *, fileobj: _Fileobj, name: str | bytes | PathLike[str] | PathLike[bytes] | Buffer | None = ..., mode: Literal['w|', 'w|xz'], 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: int | None = ..., errorlevel: int | None = ...) -> TarFile
- pandas/io/common.py:995: 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: int | None = ..., errorlevel: int | None = ..., compresslevel: int = ...) -> TarFile
+ pandas/io/common.py:995: note:     def open(cls, name: str | bytes | PathLike[str] | PathLike[bytes] | Buffer, 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: int | None = ..., errorlevel: int | None = ..., compresslevel: int = ...) -> TarFile
- pandas/io/common.py:995: 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: int | None = ..., errorlevel: int | None = ..., compresslevel: int = ...) -> TarFile
+ pandas/io/common.py:995: note:     def open(cls, fileobj: _Fileobj, *, name: str | bytes | PathLike[str] | PathLike[bytes] | Buffer | None = ..., mode: Literal['w|gz', 'w|bz2'], 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: int | None = ..., errorlevel: int | None = ..., compresslevel: int = ...) -> TarFile
+ pandas/io/common.py:995: note:     def open(cls, *, fileobj: _Fileobj, name: str | bytes | PathLike[str] | PathLike[bytes] | Buffer | None = ..., mode: Literal['w|gz', 'w|bz2'], 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: int | None = ..., errorlevel: int | None = ..., compresslevel: int = ...) -> TarFile
+ pandas/_testing/_io.py:141: error: No overload variant of "TarFile" matches argument types "Any", "str"  [call-overload]
+ pandas/_testing/_io.py:141: note:     def __init__(self, name: str | bytes | PathLike[str] | PathLike[bytes], mode: Literal['r', 'a', 'w', 'x'] = ..., fileobj: _Fileobj | None = ..., 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: int | None = ..., errorlevel: int | None = ..., copybufsize: int | None = ...) -> TarFile
+ pandas/_testing/_io.py:141: note:     def __init__(self, fileobj: _Fileobj, *, name: str | bytes | PathLike[str] | PathLike[bytes] | None = ..., mode: Literal['r', 'a', 'w', 'x'] = ..., 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: int | None = ..., errorlevel: int | None = ..., copybufsize: int | None = ...) -> TarFile
- pandas/_testing/_io.py:141: error: Argument "mode" to "TarFile" has incompatible type "str"; expected "Literal['r', 'a', 'w', 'x']"  [arg-type]

github-actions[bot] avatar Jul 04 '25 20:07 github-actions[bot]

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

pandas (https://github.com/pandas-dev/pandas)
- pandas/io/common.py:995: 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: int | None = ..., errorlevel: int | None = ...) -> TarFile
+ pandas/io/common.py:995: note:     def open(cls, name: str | bytes | PathLike[str] | PathLike[bytes], 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: int | None = ..., errorlevel: int | None = ...) -> TarFile
+ pandas/io/common.py:995: note:     def open(cls, fileobj: _Fileobj, *, name: str | bytes | PathLike[str] | PathLike[bytes] | None = ..., mode: Literal['r', 'r:*', 'r:', 'r:gz', 'r:bz2', 'r:xz'] = ..., 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: int | None = ..., errorlevel: int | None = ...) -> TarFile
+ pandas/io/common.py:995: note:     def open(cls, *, fileobj: _Fileobj, name: str | bytes | PathLike[str] | PathLike[bytes] | None = ..., mode: Literal['r', 'r:*', 'r:', 'r:gz', 'r:bz2', 'r:xz'] = ..., 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: int | None = ..., errorlevel: int | None = ...) -> TarFile
- pandas/io/common.py:995: 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: int | None = ..., errorlevel: int | None = ...) -> TarFile
+ pandas/io/common.py:995: note:     def open(cls, name: str | bytes | PathLike[str] | PathLike[bytes], 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: int | None = ..., errorlevel: int | None = ...) -> TarFile
- pandas/io/common.py:995: 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: int | None = ..., errorlevel: int | None = ...) -> TarFile
+ pandas/io/common.py:995: note:     def open(cls, fileobj: _Fileobj, *, name: str | bytes | PathLike[str] | PathLike[bytes] | None = ..., mode: Literal['x', 'x:', 'a', 'a:', 'w', 'w:', 'w:tar'], 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: int | None = ..., errorlevel: int | None = ...) -> TarFile
+ pandas/io/common.py:995: note:     def open(cls, *, fileobj: _Fileobj, name: str | bytes | PathLike[str] | PathLike[bytes] | None = ..., mode: Literal['x', 'x:', 'a', 'a:', 'w', 'w:', 'w:tar'], 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: int | None = ..., errorlevel: int | None = ...) -> TarFile
- pandas/io/common.py:995: 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: int | None = ..., errorlevel: int | None = ..., compresslevel: int = ...) -> TarFile
+ pandas/io/common.py:995: note:     def open(cls, name: str | bytes | PathLike[str] | PathLike[bytes], 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: int | None = ..., errorlevel: int | None = ..., compresslevel: int = ...) -> TarFile
- pandas/io/common.py:995: 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: int | None = ..., errorlevel: int | None = ..., compresslevel: int = ...) -> TarFile
+ pandas/io/common.py:995: note:     def open(cls, fileobj: _Fileobj, *, name: str | bytes | PathLike[str] | PathLike[bytes] | None = ..., mode: Literal['x:gz', 'x:bz2', 'w:gz', 'w:bz2'], 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: int | None = ..., errorlevel: int | None = ..., compresslevel: int = ...) -> TarFile
+ pandas/io/common.py:995: note:     def open(cls, *, fileobj: _Fileobj, name: str | bytes | PathLike[str] | PathLike[bytes] | None = ..., mode: Literal['x:gz', 'x:bz2', 'w:gz', 'w:bz2'], 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: int | None = ..., errorlevel: int | None = ..., compresslevel: int = ...) -> TarFile
- pandas/io/common.py:995: 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: int | None = ..., errorlevel: int | None = ..., preset: Literal[0, 1, 2, 3, 4, 5, 6, 7, 8, 9] | None = ...) -> TarFile
+ pandas/io/common.py:995: note:     def open(cls, name: str | bytes | PathLike[str] | PathLike[bytes], 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: int | None = ..., errorlevel: int | None = ..., preset: Literal[0, 1, 2, 3, 4, 5, 6, 7, 8, 9] | None = ...) -> TarFile
- pandas/io/common.py:995: 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: int | None = ..., errorlevel: int | None = ..., preset: Literal[0, 1, 2, 3, 4, 5, 6, 7, 8, 9] | None = ...) -> TarFile
+ pandas/io/common.py:995: note:     def open(cls, fileobj: _Fileobj, *, name: str | bytes | PathLike[str] | PathLike[bytes] | None = ..., mode: Literal['x:xz', 'w:xz'], 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: int | None = ..., errorlevel: int | None = ..., preset: Literal[0, 1, 2, 3, 4, 5, 6, 7, 8, 9] | None = ...) -> TarFile
+ pandas/io/common.py:995: note:     def open(cls, *, fileobj: _Fileobj, name: str | bytes | PathLike[str] | PathLike[bytes] | None = ..., mode: Literal['x:xz', 'w:xz'], 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: int | None = ..., errorlevel: int | None = ..., preset: Literal[0, 1, 2, 3, 4, 5, 6, 7, 8, 9] | None = ...) -> TarFile
- pandas/io/common.py:995: note:     def open(cls, name: str | bytes | PathLike[str] | PathLike[bytes] | Buffer | None, mode: Literal['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: int | None = ..., errorlevel: int | None = ...) -> TarFile
+ pandas/io/common.py:995: note:     def open(cls, name: str | bytes | PathLike[str] | PathLike[bytes] | Buffer, mode: Literal['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: int | None = ..., errorlevel: int | None = ...) -> TarFile
- pandas/io/common.py:995: note:     def open(cls, name: str | bytes | PathLike[str] | PathLike[bytes] | Buffer | None = ..., *, mode: Literal['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: int | None = ..., errorlevel: int | None = ...) -> TarFile
+ pandas/io/common.py:995: note:     def open(cls, fileobj: _Fileobj, *, name: str | bytes | PathLike[str] | PathLike[bytes] | Buffer | None = ..., mode: Literal['r|*', 'r|', 'r|gz', 'r|bz2', 'r|xz'], 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: int | None = ..., errorlevel: int | None = ...) -> TarFile
+ pandas/io/common.py:995: note:     def open(cls, *, fileobj: _Fileobj, name: str | bytes | PathLike[str] | PathLike[bytes] | Buffer | None = ..., mode: Literal['r|*', 'r|', 'r|gz', 'r|bz2', 'r|xz'], 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: int | None = ..., errorlevel: int | None = ...) -> TarFile
- pandas/io/common.py:995: note:     def open(cls, name: str | bytes | PathLike[str] | PathLike[bytes] | Buffer | None, mode: Literal['w|', '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: int | None = ..., errorlevel: int | None = ...) -> TarFile
+ pandas/io/common.py:995: note:     def open(cls, name: str | bytes | PathLike[str] | PathLike[bytes] | Buffer, mode: Literal['w|', '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: int | None = ..., errorlevel: int | None = ...) -> TarFile
- pandas/io/common.py:995: note:     def open(cls, name: str | bytes | PathLike[str] | PathLike[bytes] | Buffer | None = ..., *, mode: Literal['w|', '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: int | None = ..., errorlevel: int | None = ...) -> TarFile
+ pandas/io/common.py:995: note:     def open(cls, fileobj: _Fileobj, *, name: str | bytes | PathLike[str] | PathLike[bytes] | Buffer | None = ..., mode: Literal['w|', 'w|xz'], 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: int | None = ..., errorlevel: int | None = ...) -> TarFile
+ pandas/io/common.py:995: note:     def open(cls, *, fileobj: _Fileobj, name: str | bytes | PathLike[str] | PathLike[bytes] | Buffer | None = ..., mode: Literal['w|', 'w|xz'], 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: int | None = ..., errorlevel: int | None = ...) -> TarFile
- pandas/io/common.py:995: 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: int | None = ..., errorlevel: int | None = ..., compresslevel: int = ...) -> TarFile
+ pandas/io/common.py:995: note:     def open(cls, name: str | bytes | PathLike[str] | PathLike[bytes] | Buffer, 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: int | None = ..., errorlevel: int | None = ..., compresslevel: int = ...) -> TarFile
- pandas/io/common.py:995: 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: int | None = ..., errorlevel: int | None = ..., compresslevel: int = ...) -> TarFile
+ pandas/io/common.py:995: note:     def open(cls, fileobj: _Fileobj, *, name: str | bytes | PathLike[str] | PathLike[bytes] | Buffer | None = ..., mode: Literal['w|gz', 'w|bz2'], 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: int | None = ..., errorlevel: int | None = ..., compresslevel: int = ...) -> TarFile
+ pandas/io/common.py:995: note:     def open(cls, *, fileobj: _Fileobj, name: str | bytes | PathLike[str] | PathLike[bytes] | Buffer | None = ..., mode: Literal['w|gz', 'w|bz2'], 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: int | None = ..., errorlevel: int | None = ..., compresslevel: int = ...) -> TarFile
+ pandas/_testing/_io.py:141: error: No overload variant of "TarFile" matches argument types "Any", "str"  [call-overload]
+ pandas/_testing/_io.py:141: note:     def __init__(self, name: str | bytes | PathLike[str] | PathLike[bytes], mode: Literal['r', 'a', 'w', 'x'] = ..., fileobj: _Fileobj | None = ..., 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: int | None = ..., errorlevel: int | None = ..., copybufsize: int | None = ...) -> TarFile
+ pandas/_testing/_io.py:141: note:     def __init__(self, fileobj: _Fileobj, *, name: str | bytes | PathLike[str] | PathLike[bytes] | None = ..., mode: Literal['r', 'a', 'w', 'x'] = ..., 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: int | None = ..., errorlevel: int | None = ..., copybufsize: int | None = ...) -> TarFile
- pandas/_testing/_io.py:141: error: Argument "mode" to "TarFile" has incompatible type "str"; expected "Literal['r', 'a', 'w', 'x']"  [arg-type]

github-actions[bot] avatar Jul 04 '25 21:07 github-actions[bot]

Its already done?

alexeev-prog avatar Jul 06 '25 12:07 alexeev-prog