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

Method _sanitize_header

Lib/email/_policybase.py:298–308  ·  view source on GitHub ↗
(self, name, value)

Source from the content-addressed store, hash-verified

296 mangle_from_ = True
297
298 def _sanitize_header(self, name, value):
299 # If the header value contains surrogates, return a Header using
300 # the unknown-8bit charset to encode the bytes as encoded words.
301 if not isinstance(value, str):
302 # Assume it is already a header object
303 return value
304 if _has_surrogates(value):
305 return header.Header(value, charset=_charset.UNKNOWN8BIT,
306 header_name=name)
307 else:
308 return value
309
310 def header_source_parse(self, sourcelines):
311 """+

Callers 1

header_fetch_parseMethod · 0.95

Calls 1

_has_surrogatesFunction · 0.90

Tested by

no test coverage detected