mirror of
https://github.com/davidhalter/typeshed.git
synced 2025-12-24 12:51:27 +08:00
bz2 stub exceptions (#5199)
This commit is contained in:
@@ -1,8 +1,8 @@
|
||||
import io
|
||||
import sys
|
||||
from _typeshed import AnyPath
|
||||
from typing import IO, Any, Optional, TextIO, TypeVar, Union, overload
|
||||
from typing_extensions import Literal
|
||||
from _typeshed import AnyPath, ReadableBuffer, WriteableBuffer
|
||||
from typing import IO, Any, Iterable, List, Optional, TextIO, TypeVar, Union, overload
|
||||
from typing_extensions import Literal, SupportsIndex
|
||||
|
||||
_PathOrFile = Union[AnyPath, IO[bytes]]
|
||||
_T = TypeVar("_T")
|
||||
@@ -49,10 +49,18 @@ class BZ2File(io.BufferedIOBase, IO[bytes]):
|
||||
def __init__(
|
||||
self, filename: _PathOrFile, mode: str = ..., buffering: Optional[Any] = ..., compresslevel: int = ...
|
||||
) -> None: ...
|
||||
def read(self, size: Optional[int] = ...) -> bytes: ...
|
||||
def read1(self, size: int = ...) -> bytes: ...
|
||||
def readline(self, size: SupportsIndex = ...) -> bytes: ... # type: ignore
|
||||
def readinto(self, b: WriteableBuffer) -> int: ...
|
||||
def readlines(self, size: SupportsIndex = ...) -> List[bytes]: ...
|
||||
def seek(self, offset: int, whence: int = ...) -> int: ...
|
||||
def write(self, data: ReadableBuffer) -> int: ...
|
||||
def writelines(self, seq: Iterable[ReadableBuffer]) -> None: ...
|
||||
|
||||
class BZ2Compressor(object):
|
||||
def __init__(self, compresslevel: int = ...) -> None: ...
|
||||
def compress(self, data: bytes) -> bytes: ...
|
||||
def compress(self, __data: bytes) -> bytes: ...
|
||||
def flush(self) -> bytes: ...
|
||||
|
||||
class BZ2Decompressor(object):
|
||||
|
||||
@@ -12,6 +12,7 @@ asyncio.staggered # Added in Python 3.8
|
||||
asyncio.threads # Added in Python 3.9
|
||||
asyncio.trsock # Added in Python 3.8
|
||||
builtins.str.maketrans
|
||||
bz2.BZ2Compressor.compress # does not accept keyword arguments even though signature says it does
|
||||
cmath.log
|
||||
collections.AsyncGenerator.ag_await
|
||||
collections.AsyncGenerator.ag_code
|
||||
|
||||
@@ -13,6 +13,7 @@ asyncio.threads # Added in Python 3.9
|
||||
asyncio.trsock # Added in Python 3.8
|
||||
builtins.dict.get
|
||||
builtins.str.maketrans
|
||||
bz2.BZ2Compressor.compress # does not accept keyword arguments even though signature says it does
|
||||
cmath.log
|
||||
collections.AsyncGenerator.ag_await
|
||||
collections.AsyncGenerator.ag_code
|
||||
|
||||
@@ -23,6 +23,7 @@ asyncio.run # Bugfix involving this was backported to 3.8
|
||||
asyncio.runners.run # It just hasn't been released yet
|
||||
asyncio.threads # Added in Python 3.9
|
||||
builtins.dict.get
|
||||
bz2.BZ2Compressor.compress # does not accept keyword arguments even though signature says it does
|
||||
collections.AsyncGenerator.ag_await
|
||||
collections.AsyncGenerator.ag_code
|
||||
collections.AsyncGenerator.ag_frame
|
||||
|
||||
@@ -135,11 +135,6 @@ xml.etree.cElementTree.XMLParser.__init__ # Defined in C so has general signatu
|
||||
# positional-only complaints
|
||||
builtins.bytearray.pop
|
||||
builtins.bytearray.remove
|
||||
bz2.BZ2Compressor.compress
|
||||
bz2.BZ2File.read
|
||||
bz2.BZ2File.read1
|
||||
bz2.BZ2File.readline
|
||||
bz2.BZ2File.seek
|
||||
collections.AsyncGenerator.asend
|
||||
collections.AsyncGenerator.athrow
|
||||
collections.Container.__contains__
|
||||
|
||||
@@ -73,11 +73,7 @@ builtins.property.fset
|
||||
builtins.reversed # not a function at runtime
|
||||
builtins.staticmethod.__get__
|
||||
builtins.zip # not a function at runtime
|
||||
bz2.BZ2Decompressor.__init__
|
||||
bz2.BZ2File.readinto
|
||||
bz2.BZ2File.readlines
|
||||
bz2.BZ2File.write
|
||||
bz2.BZ2File.writelines
|
||||
bz2.BZ2Decompressor.__init__ # function does not accept parameters but C signature is set
|
||||
# The following methods were changed in point releases from Python 3.6 to 3.9
|
||||
# as part of a security fix. These excludes can be removed when the GitHub
|
||||
# action workflow uses Python versions that include the fix (adding a
|
||||
|
||||
Reference in New Issue
Block a user