From db146102985768aee2884c17d1ae002646e00b21 Mon Sep 17 00:00:00 2001 From: karl ding Date: Sat, 23 May 2020 13:41:07 -0700 Subject: [PATCH] Improve undocumented TarFile method type hints (#4056) Add type hints for undocumented tarfile.TarFile file methods called via _extract_member() when extract() is called. --- stdlib/2and3/tarfile.pyi | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/stdlib/2and3/tarfile.pyi b/stdlib/2and3/tarfile.pyi index 0a5993f45..309e06383 100644 --- a/stdlib/2and3/tarfile.pyi +++ b/stdlib/2and3/tarfile.pyi @@ -144,6 +144,18 @@ class TarFile(Iterable[TarInfo]): path: _Path = ...) -> None: ... def extractfile(self, member: Union[str, TarInfo]) -> Optional[IO[bytes]]: ... + def makedir(self, tarinfo: TarInfo, targetpath: _Path) -> None: ... # undocumented + def makefile(self, tarinfo: TarInfo, targetpath: _Path) -> None: ... # undocumented + def makeunknown(self, tarinfo: TarInfo, targetpath: _Path) -> None: ... # undocumented + def makefifo(self, tarinfo: TarInfo, targetpath: _Path) -> None: ... # undocumented + def makedev(self, tarinfo: TarInfo, targetpath: _Path) -> None: ... # undocumented + def makelink(self, tarinfo: TarInfo, targetpath: _Path) -> None: ... # undocumented + if sys.version_info >= (3, 5): + def chown(self, tarinfo: TarInfo, targetpath: _Path, numeric_owner: bool) -> None: ... # undocumented + else: + def chown(self, tarinfo: TarInfo, targetpath: _Path) -> None: ... # undocumented + def chmod(self, tarinfo: TarInfo, targetpath: _Path) -> None: ... # undocumented + def utime(self, tarinfo: TarInfo, targetpath: _Path) -> None: ... # undocumented if sys.version_info >= (3, 7): def add(self, name: str, arcname: Optional[str] = ..., recursive: bool = ..., *,