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

Method fold_binary

Lib/email/_policybase.py:346–356  ·  view source on GitHub ↗

+ Headers are folded using the Header folding algorithm, which preserves existing line breaks in the value, and wraps each resulting line to the max_line_length. If cte_type is 7bit, non-ascii binary data is CTE encoded using the unknown-8bit charset. Otherwise the

(self, name, value)

Source from the content-addressed store, hash-verified

344 return self._fold(name, value, sanitize=True)
345
346 def fold_binary(self, name, value):
347 """+
348 Headers are folded using the Header folding algorithm, which preserves
349 existing line breaks in the value, and wraps each resulting line to the
350 max_line_length. If cte_type is 7bit, non-ascii binary data is CTE
351 encoded using the unknown-8bit charset. Otherwise the original source
352 header is used, with its existing line breaks and/or binary data.
353
354 """
355 folded = self._fold(name, value, sanitize=self.cte_type=='7bit')
356 return folded.encode('ascii', 'surrogateescape')
357
358 def _fold(self, name, value, sanitize):
359 parts = []

Callers

nothing calls this directly

Calls 2

_foldMethod · 0.95
encodeMethod · 0.45

Tested by

no test coverage detected