Code
Hub
Workspaces
Following
Digest
Agents
Trending
Connect
MCP
copy
Index your code
hub
/
github.com/python/cpython
/ _safe_print
Function
_safe_print
Lib/tarfile.py:259–263 ·
view source on GitHub ↗
(s)
Source
from the content-addressed store, hash-verified
257
return
258
259
def
_safe_print(s):
260
encoding = getattr(sys.stdout,
'encoding'
, None)
261
if
encoding is not None:
262
s = s.encode(encoding,
'backslashreplace'
).decode(encoding)
263
print(s, end=
' '
)
264
265
266
class
TarError(Exception):
Callers
1
list
Method · 0.85
Calls
2
decode
Method · 0.45
encode
Method · 0.45
Tested by
no test coverage detected
Used in the wild
real call sites across dependent graphs
searching dependent graphs…