-
-
Notifications
You must be signed in to change notification settings - Fork 1.9k
Closed
Description
According to https://github.com/psf/requests/blob/2d5517682b3b38547634d153cea43d48fbc8cdb5/requests/models.py#L170 It should be possible to provide files={"fieldname": ("filename", [bytes-object])}
, but since the last update of mypy this fails with
packet_analyser/daemon/uploader.py:78: error: Argument "files" to "post" has incompatible type "Dict[str, Tuple[str, bytes]]"; expected "Optional[Union[MutableMapping[str, IO[Any]], MutableMapping[str, Tuple[Optional[str], IO[Any]]], MutableMapping[str, Tuple[Optional[str], IO[Any], str]], MutableMapping[str, Tuple[Optional[str], IO[Any], str, MutableMapping[str, str]]]]]" [arg-type]
The issue seems to be in
typeshed/stubs/requests/requests/sessions.pyi
Lines 51 to 56 in 63fb9af
_Files: TypeAlias = ( | |
MutableMapping[str, IO[Any]] | |
| MutableMapping[str, tuple[str | None, IO[Any]]] | |
| MutableMapping[str, tuple[str | None, IO[Any], str]] | |
| MutableMapping[str, tuple[str | None, IO[Any], str, _TextMapping]] | |
) |
Can this be fixed?
Metadata
Metadata
Assignees
Labels
No labels