Skip to content

Commit ed6f197

Browse files
committed
Formatting
1 parent 050491c commit ed6f197

2 files changed

Lines changed: 11 additions & 7 deletions

File tree

Lib/email/_header_value_parser.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2835,6 +2835,7 @@ def _steal_trailing_WSP_if_exists(lines):
28352835
lines.pop()
28362836
return wsp
28372837

2838+
28382839
def _steal_all_trailing_WSP_if_exists(lines):
28392840
lines_popped = False
28402841
wsp_lines = []
@@ -2856,6 +2857,7 @@ def _steal_all_trailing_WSP_if_exists(lines):
28562857
lines.append(' ' if lines else '')
28572858
return ''.join(wsp_lines)
28582859

2860+
28592861
def _refold_parse_tree(parse_tree, *, policy):
28602862
"""Return string of contents of parse_tree folded according to RFC rules.
28612863

Lib/test/test_email/test_generator.py

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -393,17 +393,19 @@ def test_defaults_handle_spaces_at_start_of_continuation_line(self):
393393
g.flatten(msg)
394394
self.assertEqual(s.getvalue(), expected)
395395

396-
# gh-144156
397-
# https://github.com/python/cpython/issues/144156
396+
# gh-144156: fold between non-encoded and encoded words don't need to encoded
397+
# the separating space
398398
def test_defaults_handle_spaces_at_start_of_continuation_line_2(self):
399399
source = ("Re: [SOS-1495488] Commande et livraison - Demande de retour - "
400400
"bibijolie - 251210-AABBCC - Abo actualités digitales 20 semaines "
401401
"d’abonnement à 24 heures, Bilan, Tribune de Genève et tous les titres Tamedia")
402-
expected = (b"Subject: "
403-
b"Re: [SOS-1495488] Commande et livraison - Demande de retour -\n"
404-
b" bibijolie - 251210-AABBCC - Abo =?utf-8?q?actualit=C3=A9s?= digitales 20\n"
405-
b" semaines =?utf-8?q?d=E2=80=99abonnement_=C3=A0?= 24 heures, Bilan, Tribune de\n"
406-
b" =?utf-8?q?Gen=C3=A8ve?= et tous les titres Tamedia\n\n")
402+
expected = (
403+
b"Subject: "
404+
b"Re: [SOS-1495488] Commande et livraison - Demande de retour -\n"
405+
b" bibijolie - 251210-AABBCC - Abo =?utf-8?q?actualit=C3=A9s?= digitales 20\n"
406+
b" semaines =?utf-8?q?d=E2=80=99abonnement_=C3=A0?= 24 heures, Bilan, Tribune de\n"
407+
b" =?utf-8?q?Gen=C3=A8ve?= et tous les titres Tamedia\n\n"
408+
)
407409
msg = EmailMessage()
408410
msg['Subject'] = source
409411
s = io.BytesIO()

0 commit comments

Comments
 (0)