Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bump mypy from 1.8.0 to 1.11.2 #901

Merged
merged 2 commits into from
Sep 3, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
23 changes: 14 additions & 9 deletions openapi_core/deserializing/media_types/util.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,10 @@
from email.message import Message
from email.parser import Parser
from json import loads
from typing import Any
from typing import Iterator
from typing import Mapping
from typing import Tuple
from urllib.parse import parse_qsl
from xml.etree.ElementTree import Element
from xml.etree.ElementTree import fromstring
Expand Down Expand Up @@ -57,12 +60,14 @@ def data_form_loads(value: bytes, **parameters: str) -> Mapping[str, Any]:
header = f'Content-Type: {mimetype}; boundary="{boundary}"'
text = "\n\n".join([header, decoded])
parts = parser.parsestr(text, headersonly=False)
return ImmutableMultiDict(
[
(
part.get_param("name", header="content-disposition"),
part.get_payload(decode=True),
)
for part in parts.get_payload()
]
)
return ImmutableMultiDict(list(iter_payloads(parts)))


def iter_payloads(parts: Message) -> Iterator[Tuple[str, bytes]]:
for part in parts.get_payload():
assert isinstance(part, Message)
name = part.get_param("name", header="content-disposition")
assert isinstance(name, str)
payload = part.get_payload(decode=True)
assert isinstance(payload, bytes)
yield name, payload
2 changes: 1 addition & 1 deletion openapi_core/validation/validators.py
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ def __init__(
"schema_validators_factory is not assigned"
)
self.path_finder_cls = path_finder_cls or self.path_finder_cls
if self.path_finder_cls is NotImplemented: # type: ignore[comparison-overlap]
if self.path_finder_cls is NotImplemented:
raise NotImplementedError("path_finder_cls is not assigned")
self.spec_validator_cls = spec_validator_cls or self.spec_validator_cls
self.format_validators = format_validators
Expand Down
58 changes: 29 additions & 29 deletions poetry.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading