Skip to content

Commit 4ce0a1d

Browse files
authored
fix(tracing): Set default on json.dumps in compute_tracestate_value to ensure string conversion (getsentry#1318)
1 parent 54c0bde commit 4ce0a1d

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

sentry_sdk/tracing_utils.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@
1111
capture_internal_exceptions,
1212
Dsn,
1313
logger,
14+
safe_str,
1415
to_base64,
1516
to_string,
1617
from_base64,
@@ -288,7 +289,7 @@ def compute_tracestate_value(data):
288289
tracestate entry.
289290
"""
290291

291-
tracestate_json = json.dumps(data)
292+
tracestate_json = json.dumps(data, default=safe_str)
292293

293294
# Base64-encoded strings always come out with a length which is a multiple
294295
# of 4. In order to achieve this, the end is padded with one or more `=`

0 commit comments

Comments
 (0)