Skip to content

Commit e9e55f2

Browse files
committed
fix: lint
1 parent a436bd5 commit e9e55f2

File tree

3 files changed

+11
-12
lines changed

3 files changed

+11
-12
lines changed

Lib/email/_policybase.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -316,7 +316,7 @@ def header_source_parse(self, sourcelines):
316316
# there is a WSP after '<HeaderName>:', the WSP will be moved to the front
317317
# of the value according to RFC5322, section 2.2.3.
318318
#
319-
# However, the WSP is not part of the value; therefore, we must
319+
# However, the WSP is not part of the value; therefore, we must
320320
# remove it.
321321

322322
no_first_value = value.strip() == '' and len(sourcelines) > 1

Lib/test/test_email/test_message.py

Lines changed: 8 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -957,7 +957,7 @@ def test_folding_with_utf8_encoding_8(self):
957957
b'123456789 123456789 123456789 123456789 '
958958
b'123456789-123456789\n 123456789 Hello '
959959
b'=?utf-8?q?W=C3=B6rld!?= 123456789 123456789\n\n')
960-
960+
961961

962962
def test_folding_with_short_nospace_1(self):
963963
# bpo-36520
@@ -969,12 +969,12 @@ def test_folding_with_short_nospace_1(self):
969969
m['Message-ID'] = '12345678912345678123456789123456789123456789'
970970
parsed_msg = message_from_bytes(m.as_bytes(), policy=policy.default)
971971
self.assertEqual(parsed_msg['Message-ID'], m['Message-ID'])
972-
972+
973973
def test_folding_with_long_nospace_default_policy_1(self):
974974
# Fixed: https://github.com/python/cpython/issues/124452
975-
#
976-
# When the value is too long, it should be converted back
977-
# to its original form without any modifications.
975+
#
976+
# When the value is too long, it should be converted back
977+
# to its original form without any modifications.
978978

979979
m = EmailMessage(policy.default)
980980
m['Message-ID'] = '12345678912345678123456789123456789123456789'\
@@ -988,17 +988,16 @@ def test_folding_with_long_nospace_default_policy_1(self):
988988

989989
def test_folding_with_long_nospace_compat32_policy_1(self):
990990
# Fixed: https://github.com/python/cpython/issues/124452
991-
#
992-
# When the value is too long, it should be converted back
993-
# to its original form without any modifications.
991+
#
992+
# When the value is too long, it should be converted back
993+
# to its original form without any modifications.
994994

995995
m = EmailMessage(policy.compat32)
996996
m['Message-ID'] = '12345678912345678123456789123456789123456789'\
997997
'12345678912345678123456789123456789123456789'
998998
parsed_msg = message_from_bytes(m.as_bytes(), policy=policy.default)
999999
self.assertEqual(parsed_msg['Message-ID'], m['Message-ID'])
10001000

1001-
10021001
def test_get_body_malformed(self):
10031002
"""test for bpo-42892"""
10041003
msg = textwrap.dedent("""\
Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
1-
Fix the mismatched email headers after converting them to bytes and parsing them into an email message.
1+
Fix the mismatched email headers after converting them to bytes and parsing them into an email message.
22
This issue only occurs with long text without any spaces.
3-
Root cause: The email library doesn't know how to wrap long text without spaces, but it wraps it anyway with a leading WSP, which is not removed when converting bytes to EmailMessage.
3+
Root cause: The email library doesn't know how to wrap long text without spaces, but it wraps it anyway with a leading WSP, which is not removed when converting bytes to EmailMessage.

0 commit comments

Comments
 (0)