Repository navigation
probe - #7554
Closed
DawnofGenX wants to merge 2 commits into
Closed
probe#7554DawnofGenX wants to merge 2 commits into
DawnofGenX wants to merge 2 commits into
Conversation
…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>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
probe