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

Method fold_binary

Lib/email/_policybase.py:336–346  ·  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

334 return self._fold(name, value, sanitize=True)
335
336 def fold_binary(self, name, value):
337 """+
338 Headers are folded using the Header folding algorithm, which preserves
339 existing line breaks in the value, and wraps each resulting line to the
340 max_line_length. If cte_type is 7bit, non-ascii binary data is CTE
341 encoded using the unknown-8bit charset. Otherwise the original source
342 header is used, with its existing line breaks and/or binary data.
343
344 """
345 folded = self._fold(name, value, sanitize=self.cte_type=='7bit')
346 return folded.encode('ascii', 'surrogateescape')
347
348 def _fold(self, name, value, sanitize):
349 parts = []

Callers

nothing calls this directly

Calls 2

_foldMethod · 0.95
encodeMethod · 0.45

Tested by

no test coverage detected