Skip to content

Commit 40d6592

Browse files
authored
tarfile.gettarinfo() accepts PathLike objects (#7832)
This method has accepted PathLike objects since Python 3.6 (python/cpython#512)
1 parent f8db698 commit 40d6592

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

stdlib/tarfile.pyi

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -315,7 +315,9 @@ class TarFile:
315315
) -> None: ...
316316

317317
def addfile(self, tarinfo: TarInfo, fileobj: IO[bytes] | None = ...) -> None: ...
318-
def gettarinfo(self, name: str | None = ..., arcname: str | None = ..., fileobj: IO[bytes] | None = ...) -> TarInfo: ...
318+
def gettarinfo(
319+
self, name: StrOrBytesPath | None = ..., arcname: str | None = ..., fileobj: IO[bytes] | None = ...
320+
) -> TarInfo: ...
319321
def close(self) -> None: ...
320322

321323
if sys.version_info >= (3, 9):

0 commit comments

Comments
 (0)