Skip to content

Commit f3a42bc

Browse files
Added base64 encoding
1 parent 822f4c0 commit f3a42bc

File tree

6 files changed

+11
-8
lines changed

6 files changed

+11
-8
lines changed

core/harambe_core/observer/serialization_observer.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
import base64
12
from typing import Any, Callable, TypeVar, TypedDict
23
from urllib.parse import quote
34

@@ -37,12 +38,14 @@ async def on_queue_url(self, url: URL, context: Context, options: Options) -> No
3738
async def on_download(
3839
self, download_url: str, filename: str, content: bytes, path: str
3940
) -> "DownloadMeta":
41+
encoded_content = base64.b64encode(content).decode("ascii")
42+
4043
payload: Payload = {
4144
"type": "on_download",
4245
"data": {
4346
"download_url": download_url,
4447
"filename": filename,
45-
"content": content.decode("utf-8"),
48+
"content": encoded_content,
4649
"path": path,
4750
},
4851
}

core/pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[project]
22
name = "harambe-core"
3-
version = "0.77.4"
3+
version = "0.77.5"
44
description = "Core types for harambe SDK 🐒🍌"
55
authors = [
66
{ name = "Adam Watkins", email = "adam@reworkd.ai" }

core/uv.lock

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

sdk/harambe/instrumentation.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -132,7 +132,7 @@ async def _wrapper(func, _instance, args, kwargs):
132132

133133
try:
134134
result = await func(*args, **kwargs)
135-
event["result"] = _safe_repr(result) # ← UTF-8-safe
135+
event["result"] = _safe_repr(result)
136136

137137
except Exception as e:
138138
event["result"] = _safe_repr(e)

sdk/pyproject.toml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,14 @@
11
[project]
22
name = "harambe-sdk"
3-
version = "0.77.4"
3+
version = "0.77.5"
44
description = "Data extraction SDK for Playwright 🐒🍌"
55
authors = [
66
{ name = "Adam Watkins", email = "adam@reworkd.ai" }
77
]
88
requires-python = ">=3.11,<4.0"
99
readme = "README.md"
1010
dependencies = [
11-
"harambe_core==0.77.4",
11+
"harambe_core==0.77.5",
1212
"playwright==1.47.0",
1313
"beautifulsoup4==4.12.3",
1414
"requests==2.32.3",

sdk/uv.lock

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)