MCPcopy Index your code
hub / github.com/RustPython/RustPython / _sanitize_header

Method _sanitize_header

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

Source from the content-addressed store, hash-verified

287 mangle_from_ = True
288
289 def _sanitize_header(self, name, value):
290 # If the header value contains surrogates, return a Header using
291 # the unknown-8bit charset to encode the bytes as encoded words.
292 if not isinstance(value, str):
293 # Assume it is already a header object
294 return value
295 if _has_surrogates(value):
296 return header.Header(value, charset=_charset.UNKNOWN8BIT,
297 header_name=name)
298 else:
299 return value
300
301 def header_source_parse(self, sourcelines):
302 """+

Callers 1

header_fetch_parseMethod · 0.95

Calls 2

_has_surrogatesFunction · 0.90
isinstanceFunction · 0.85

Tested by

no test coverage detected