requests: Update adapters.pyi (#7544)

The cert can be
* A string / bytes which is a path to a certfile
* A tuple with two string / bytes, where the first is the certfile and the second is a keyfile
* None (optional)

The tuple could be anything indexable, but there are strict requirement to actualle have two items, don't know if there is something more generic

See https://github.com/psf/requests/blob/main/requests/adapters.py#L242-L248
This commit is contained in:
Kalle Møller
2022-03-27 05:41:25 +02:00
committed by GitHub
parent 61b22db692
commit 9aa64fdc22

View File

@@ -1,4 +1,4 @@
from typing import Any, Container, Mapping, Text
from typing import Any, Mapping, Text
from urllib3 import exceptions as urllib3_exceptions, poolmanager, response
from urllib3.util import retry
@@ -43,7 +43,7 @@ class BaseAdapter:
stream: bool = ...,
timeout: None | float | tuple[float, float] | tuple[float, None] = ...,
verify: bool | str = ...,
cert: None | bytes | Text | Container[bytes | Text] = ...,
cert: None | bytes | Text | tuple[bytes | Text, bytes | Text] = ...,
proxies: Mapping[str, str] | None = ...,
) -> Response: ...
def close(self) -> None: ...
@@ -72,6 +72,6 @@ class HTTPAdapter(BaseAdapter):
stream: bool = ...,
timeout: None | float | tuple[float, float] | tuple[float, None] = ...,
verify: bool | str = ...,
cert: None | bytes | Text | Container[bytes | Text] = ...,
cert: None | bytes | Text | tuple[bytes | Text, bytes | Text] = ...,
proxies: Mapping[str, str] | None = ...,
) -> Response: ...