Skip to content

Commit 8211f50

Browse files
authored
fix(sdk): coerce bytearray to bytes in process_request payload (#1081)
mypy 2.0 (newly installed in CI) flagged that the bytes|bytearray branch assigned a bytearray into a payload typed dict[str, bytes]. Coerce with bytes(raw) — type-correct, and downstream urllib.request.Request wants bytes anyway.
1 parent 41532e2 commit 8211f50

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

modules/sdk/karrio/core/utils/helpers.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -174,7 +174,7 @@ def process_request(
174174
if raw is None:
175175
payload = {}
176176
elif isinstance(raw, (bytes, bytearray)):
177-
payload = dict(data=raw)
177+
payload = dict(data=bytes(raw))
178178
elif isinstance(raw, str):
179179
payload = dict(data=raw.encode("utf-8"))
180180
else:

0 commit comments

Comments
 (0)