mirror of
https://github.com/python/cpython.git
synced 2025-10-06 15:11:58 +00:00
Issue #27895: Spelling fixes (Contributed by Ville Skyttä).
This commit is contained in:
parent
613debcf0a
commit
15f44ab043
72 changed files with 121 additions and 121 deletions
|
@ -141,7 +141,7 @@ def _encode_base64(data, max_line_length):
|
|||
def _encode_text(string, charset, cte, policy):
|
||||
lines = string.encode(charset).splitlines()
|
||||
linesep = policy.linesep.encode('ascii')
|
||||
def embeded_body(lines): return linesep.join(lines) + linesep
|
||||
def embedded_body(lines): return linesep.join(lines) + linesep
|
||||
def normal_body(lines): return b'\n'.join(lines) + b'\n'
|
||||
if cte==None:
|
||||
# Use heuristics to decide on the "best" encoding.
|
||||
|
@ -152,7 +152,7 @@ def _encode_text(string, charset, cte, policy):
|
|||
if (policy.cte_type == '8bit' and
|
||||
max(len(x) for x in lines) <= policy.max_line_length):
|
||||
return '8bit', normal_body(lines).decode('ascii', 'surrogateescape')
|
||||
sniff = embeded_body(lines[:10])
|
||||
sniff = embedded_body(lines[:10])
|
||||
sniff_qp = quoprimime.body_encode(sniff.decode('latin-1'),
|
||||
policy.max_line_length)
|
||||
sniff_base64 = binascii.b2a_base64(sniff)
|
||||
|
@ -171,7 +171,7 @@ def _encode_text(string, charset, cte, policy):
|
|||
data = quoprimime.body_encode(normal_body(lines).decode('latin-1'),
|
||||
policy.max_line_length)
|
||||
elif cte == 'base64':
|
||||
data = _encode_base64(embeded_body(lines), policy.max_line_length)
|
||||
data = _encode_base64(embedded_body(lines), policy.max_line_length)
|
||||
else:
|
||||
raise ValueError("Unknown content transfer encoding {}".format(cte))
|
||||
return cte, data
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue