Add PEP 706 filters to tarfile (#10316)

Fixes #10315

Co-authored-by: Sebastian Rittau <srittau@rittau.biz>
This commit is contained in:
Jelle Zijlstra
2023-06-14 07:08:32 -07:00
committed by GitHub
parent 5f9d05c7f5
commit 5beddbe883
8 changed files with 116 additions and 23 deletions

View File

@@ -2,6 +2,7 @@ import os
import sys
from _typeshed import BytesPath, FileDescriptorOrPath, StrOrBytesPath, StrPath, SupportsRead, SupportsWrite
from collections.abc import Callable, Iterable, Sequence
from tarfile import _TarfileFilter
from typing import Any, AnyStr, NamedTuple, Protocol, TypeVar, overload
from typing_extensions import TypeAlias
@@ -192,9 +193,9 @@ def register_archive_format(
) -> None: ...
def unregister_archive_format(name: str) -> None: ...
if sys.version_info >= (3, 12):
if sys.version_info >= (3, 8):
def unpack_archive(
filename: StrPath, extract_dir: StrPath | None = None, format: str | None = None, *, filter: str | None = None
filename: StrPath, extract_dir: StrPath | None = None, format: str | None = None, *, filter: _TarfileFilter | None = None
) -> None: ...
else: