MCPcopy Create free account
hub / github.com/celery/celery / _repr_binary_bytes

Function _repr_binary_bytes

celery/utils/saferepr.py:132–138  ·  view source on GitHub ↗
(val)

Source from the content-addressed store, hash-verified

130
131
132def _repr_binary_bytes(val):
133 # type: (bytes) -> str
134 try:
135 return val.decode('utf-8')
136 except UnicodeDecodeError:
137 # possibly not unicode, but binary data so format as hex.
138 return val.hex()
139
140
141def _format_chars(val, maxlen):

Callers 1

_format_binary_bytesFunction · 0.85

Calls 1

decodeMethod · 0.45

Tested by

no test coverage detected