Skip to content

gh-160601: Handle surrogate characters in sampling profiler binary output - #160615

Open
zolaski333 wants to merge 1 commit into
python:mainfrom
zolaski333:codex/gh-160601-binary-profiler-surrogates
Open

zolaski333 wants to merge 1 commit into
python:mainfrom
zolaski333:codex/gh-160601-binary-profiler-surrogates

Conversation

@zolaski333

@zolaski333 zolaski333 commented Oct 24, 2026 •

Copy link
Copy Markdown
Contributor

Encode sampled filenames and function names using UTF-8 with backslashreplace, preventing UnicodeEncodeError when they contain surrogate characters. The string table remains valid UTF-8 and compatible with the existing reader.

Add regression coverage for surrogate characters in both filenames and function names, including mixed Unicode names and repeated samples.

Validation on Windows:

  • test_profiling: passed.
  • Binary format tests with a Debug build and -R 3:3: passed, no leaks detected.
  • End-to-end binary capture and JSONL replay: passed.
  • patchcheck and git diff --check: passed.

Zstd compression was unavailable in this Windows build.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant