Skip to content

Commit 3d6b955

Browse files
committed
Fixing an issue with pluggy and surrogate escape characters during tracing. #13750 in Pytest
1 parent 5b24a4d commit 3d6b955

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

src/pluggy/_tracing.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,8 @@ def _format_message(self, tags: Sequence[str], args: Sequence[object]) -> str:
4141

4242
def _processmessage(self, tags: tuple[str, ...], args: tuple[object, ...]) -> None:
4343
if self._writer is not None and args:
44-
self._writer(self._format_message(tags, args))
44+
msg = self._format_message(tags, args)
45+
self._writer(msg.encode("utf-8", "replace").decode("utf-8"))
4546
try:
4647
processor = self._tags2proc[tags]
4748
except KeyError:

0 commit comments

Comments
 (0)