Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit e0a39de

Browse files
committed
#18380: merge with 3.3.
2 parents c2464bf + 2a99d5d commit e0a39de

3 files changed

Lines changed: 6 additions & 1 deletion

File tree

Lib/email/quoprimime.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -319,4 +319,4 @@ def header_decode(s):
319319
the high level email.header class for that functionality.
320320
"""
321321
s = s.replace('_', ' ')
322-
return re.sub(r'=[a-fA-F0-9]{2}', _unquote_match, s, re.ASCII)
322+
return re.sub(r'=[a-fA-F0-9]{2}', _unquote_match, s, flags=re.ASCII)

Lib/test/test_email/test_email.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4048,6 +4048,10 @@ def test_header_decode_two_lines(self):
40484048
def test_header_decode_non_ascii(self):
40494049
self._test_header_decode('hello=C7there', 'hello\xc7there')
40504050

4051+
def test_header_decode_re_bug_18380(self):
4052+
# Issue 18380: Call re.sub with a positional argument for flags in the wrong position
4053+
self.assertEqual(quoprimime.header_decode('=30' * 257), '0' * 257)
4054+
40514055
def _test_decode(self, encoded, expected_decoded, eol=None):
40524056
if eol is None:
40534057
decoded = quoprimime.decode(encoded)

Misc/ACKS

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -871,6 +871,7 @@ Alessandro Moura
871871
Pablo Mouzo
872872
Mher Movsisyan
873873
Ruslan Mstoi
874+
Valentina Mukhamedzhanova
874875
Michael Mulich
875876
Sape Mullender
876877
Sjoerd Mullender

0 commit comments

Comments
 (0)