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