Skip to content

probe - #7554

Closed
DawnofGenX wants to merge 2 commits into
getsentry:masterfrom
DawnofGenX:test-pr-probe
Closed

probe#7554
DawnofGenX wants to merge 2 commits into
getsentry:masterfrom
DawnofGenX:test-pr-probe

Conversation

@DawnofGenX

Copy link
Copy Markdown

probe

DawnofGenX and others added 2 commits September 20, 2026 19:07
…rning

Under `python -b`, stringify BSON bytes values (the `lsid` session id,
a BSON `Binary`/`bytes` subclass, and bytes values inside commands
serialized via `json.dumps(..., default=str)`) emits
`BytesWarning: str() on a bytes instance` and produces useless
`b'...'` strings.

Route these conversions through a small `_bytes_safe_str()` helper that
decodes UTF-8 with a replacement fallback for undecodable bytes, and
adds regression tests that turn BytesWarning into an error.

Fixes getsentry#4782
…g it

The logical session id is a BSON Binary UUID (random bytes), not text.
UTF-8-decoding it with errors='replace' is lossy and lets distinct ids
collide, defeating its purpose as an identifier. Render it as hex
instead, which is stable and lossless while still avoiding BytesWarning
from str() (getsentry#4782, per Bugbot review).

Co-Authored-By: Claude <noreply@anthropic.com>
@DawnofGenX
DawnofGenX requested a review from a team as a code owner September 21, 2026 13:13
@DawnofGenX DawnofGenX closed this Sep 21, 2026
@DawnofGenX
DawnofGenX deleted the test-pr-probe branch September 21, 2026 13:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant