From 14824d0032ab3e8032c90a74792b5d99b60fb519 Mon Sep 17 00:00:00 2001 From: Daniel K Date: Sun, 10 May 2026 01:01:29 +0200 Subject: [PATCH] fix(sdk): coerce bytearray to bytes in process_request payload MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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. --- modules/sdk/karrio/core/utils/helpers.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/sdk/karrio/core/utils/helpers.py b/modules/sdk/karrio/core/utils/helpers.py index 1292dfe1da..e785f9d9d0 100644 --- a/modules/sdk/karrio/core/utils/helpers.py +++ b/modules/sdk/karrio/core/utils/helpers.py @@ -174,7 +174,7 @@ def process_request( if raw is None: payload = {} elif isinstance(raw, (bytes, bytearray)): - payload = dict(data=raw) + payload = dict(data=bytes(raw)) elif isinstance(raw, str): payload = dict(data=raw.encode("utf-8")) else: