Skip to content

fix: safe formatting for surrogates in pluggy tracing - #716

Open
ltsyk wants to merge 1 commit into
pytest-dev:mainfrom
ltsyk:fix/tracing-surrogate-encode-error
Open

fix: safe formatting for surrogates in pluggy tracing#716
ltsyk wants to merge 1 commit into
pytest-dev:mainfrom
ltsyk:fix/tracing-surrogate-encode-error

Conversation

@ltsyk

@ltsyk ltsyk commented Jul 30, 2026

Copy link
Copy Markdown

Summary

Tracing crashed with UnicodeEncodeError when hook args contained surrogate escapes.

Change

Format trace values with backslashreplace so surrogates are escaped safely.

Fixes #681

Avoid UnicodeEncodeError in tracing (issue pytest-dev#681)
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.

Tracing crashes with UnicodeEncodeError on surrogate escapes in hook arguments/results

1 participant