MCPcopy Index your code
hub / github.com/python/cpython / escape_stdout

Function escape_stdout

Lib/_pyrepl/pager.py:56–59  ·  view source on GitHub ↗
(text: str)

Source from the content-addressed store, hash-verified

54
55
56def escape_stdout(text: str) -> str:
57 # Escape non-encodable characters to avoid encoding errors later
58 encoding = getattr(sys.stdout, 'encoding', None) or 'utf-8'
59 return text.encode(encoding, 'backslashreplace').decode(encoding)
60
61
62def escape_less(s: str) -> str:

Callers 2

tty_pagerFunction · 0.85
plain_pagerFunction · 0.85

Calls 2

decodeMethod · 0.45
encodeMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…