mirror of
https://github.com/davidhalter/typeshed.git
synced 2025-12-06 20:24:30 +08:00
zipfile.ZipFile: fix fp, extract (#3828)
* zipfile: fp is None in a lot of error cases * zipfile: pwd can be None in extract Co-authored-by: hauntsaninja <>
This commit is contained in:
@@ -66,7 +66,7 @@ class ZipFile:
|
||||
debug: int
|
||||
comment: bytes
|
||||
filelist: List[ZipInfo]
|
||||
fp: IO[bytes]
|
||||
fp: Optional[IO[bytes]]
|
||||
NameToInfo: Dict[Text, ZipInfo]
|
||||
start_dir: int # undocumented
|
||||
if sys.version_info >= (3, 8):
|
||||
@@ -102,7 +102,7 @@ class ZipFile:
|
||||
def infolist(self) -> List[ZipInfo]: ...
|
||||
def namelist(self) -> List[Text]: ...
|
||||
def open(self, name: _SZI, mode: Text = ..., pwd: Optional[bytes] = ..., *, force_zip64: bool = ...) -> IO[bytes]: ...
|
||||
def extract(self, member: _SZI, path: Optional[_SZI] = ..., pwd: bytes = ...) -> str: ...
|
||||
def extract(self, member: _SZI, path: Optional[_SZI] = ..., pwd: Optional[bytes] = ...) -> str: ...
|
||||
def extractall(
|
||||
self, path: Optional[_Path] = ..., members: Optional[Iterable[Text]] = ..., pwd: Optional[bytes] = ...
|
||||
) -> None: ...
|
||||
|
||||
@@ -915,6 +915,4 @@ xml.etree.cElementTree.TreeBuilder.start
|
||||
xml.sax.xmlreader.AttributesImpl.has_key
|
||||
zipfile.ZipExtFile.read
|
||||
zipfile.ZipExtFile.readline
|
||||
zipfile.ZipFile.extract
|
||||
zipfile.ZipFile.fp
|
||||
zlib.compressobj
|
||||
|
||||
Reference in New Issue
Block a user