Skip to content

Commit b9df7f8

Browse files
committed
fix: Do not crash on unicode queries
Fix getsentry#512
1 parent fa06bcb commit b9df7f8

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

sentry_sdk/tracing.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
import sentry_sdk
88

99
from sentry_sdk.serializer import partial_serialize
10-
from sentry_sdk.utils import capture_internal_exceptions, logger
10+
from sentry_sdk.utils import capture_internal_exceptions, logger, to_string
1111
from sentry_sdk._compat import PY2
1212
from sentry_sdk._types import MYPY
1313

@@ -404,7 +404,7 @@ def _format_sql(cursor, sql):
404404
except Exception:
405405
real_sql = None
406406

407-
return real_sql or str(sql)
407+
return real_sql or to_string(sql)
408408

409409

410410
@contextlib.contextmanager

0 commit comments

Comments
 (0)