Description
How do you use Sentry?
Sentry Saas (sentry.io)
Version
2.3.1
Steps to Reproduce
I'm using a UUID's .bytes
as a key in Redis, instead of a human-readable string:
import uuid
redis_client.lrange(uuid.uuid4().bytes, 0, -1)
# or
redis_client.lrange(b'\x14\x00\xa3\xc0\xf5ZB\xe9\x83+\x1e\xe7\xaa\xb8\xb7A', 0, -1)
Expected Result
With Sentry SDK version 2.3.0, it works fine.
Actual Result
With version 2.3.1, I get a UnicodeDecodeError:
File "/opt/poetry/lib/python3.12/site-packages/redis/commands/core.py", line 2755, in lrange
return self.execute_command("LRANGE", name, start, end)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/opt/poetry/lib/python3.12/site-packages/sentry_sdk/integrations/redis/_sync_common.py", line 72, in sentry_patched_execute_command
cache_properties = _compile_cache_span_properties(
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/opt/poetry/lib/python3.12/site-packages/sentry_sdk/integrations/redis/modules/caches.py", line 32, in _compile_cache_span_properties
key = _get_safe_key(redis_command, args, kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/opt/poetry/lib/python3.12/site-packages/sentry_sdk/integrations/redis/utils.py", line 60, in _get_safe_key
key = args[0].decode() if isinstance(args[0], bytes) else args[0]
^^^^^^^^^^^^^^^^
This appears to be have been introduced in #3101
Metadata
Metadata
Assignees
Type
Projects
Status
No status