mirror of
https://github.com/davidhalter/typeshed.git
synced 2026-05-06 21:43:59 +08:00
Fix incorrect keyword-only arguments in tarfile.open() (#13814)
This commit is contained in:
@@ -11,3 +11,7 @@ tarfile.open("test.tar.xz", "w:xz", preset=9)
|
||||
# Test with invalid preset values
|
||||
tarfile.open("test.tar.xz", "w:xz", preset=-1) # type: ignore
|
||||
tarfile.open("test.tar.xz", "w:xz", preset=10) # type: ignore
|
||||
|
||||
# Test pipe modes
|
||||
tarfile.open("test.tar.xz", "r|*")
|
||||
tarfile.open("test.tar.xz", mode="r|*")
|
||||
|
||||
@@ -304,6 +304,25 @@ class TarFile:
|
||||
) -> Self: ...
|
||||
@overload
|
||||
@classmethod
|
||||
def open(
|
||||
cls,
|
||||
name: StrOrBytesPath | ReadableBuffer | None,
|
||||
mode: Literal["r|*", "r|", "r|gz", "r|bz2", "r|xz"],
|
||||
fileobj: _Fileobj | None = None,
|
||||
bufsize: int = 10240,
|
||||
*,
|
||||
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 = ...,
|
||||
) -> Self: ...
|
||||
@overload
|
||||
@classmethod
|
||||
def open(
|
||||
cls,
|
||||
name: StrOrBytesPath | ReadableBuffer | None = None,
|
||||
@@ -323,6 +342,25 @@ class TarFile:
|
||||
) -> Self: ...
|
||||
@overload
|
||||
@classmethod
|
||||
def open(
|
||||
cls,
|
||||
name: StrOrBytesPath | WriteableBuffer | None,
|
||||
mode: Literal["w|", "w|xz"],
|
||||
fileobj: _Fileobj | None = None,
|
||||
bufsize: int = 10240,
|
||||
*,
|
||||
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 = ...,
|
||||
) -> Self: ...
|
||||
@overload
|
||||
@classmethod
|
||||
def open(
|
||||
cls,
|
||||
name: StrOrBytesPath | WriteableBuffer | None = None,
|
||||
@@ -342,6 +380,26 @@ class TarFile:
|
||||
) -> Self: ...
|
||||
@overload
|
||||
@classmethod
|
||||
def open(
|
||||
cls,
|
||||
name: StrOrBytesPath | WriteableBuffer | None,
|
||||
mode: Literal["w|gz", "w|bz2"],
|
||||
fileobj: _Fileobj | None = None,
|
||||
bufsize: int = 10240,
|
||||
*,
|
||||
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 = 9,
|
||||
) -> Self: ...
|
||||
@overload
|
||||
@classmethod
|
||||
def open(
|
||||
cls,
|
||||
name: StrOrBytesPath | WriteableBuffer | None = None,
|
||||
|
||||
Reference in New Issue
Block a user