Skip to content
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Add tests for quoprimime.decode() with eol=CRLF
  • Loading branch information
stefanzetzsche committed Mar 11, 2026
commit 948421f95d2bf656bf4a34ccc47f16ffec2da5e2
11 changes: 11 additions & 0 deletions Lib/test/test_email/test_email.py
Original file line number Diff line number Diff line change
Expand Up @@ -4828,6 +4828,17 @@ def test_decode_soft_line_break(self):
def test_decode_false_quoting(self):
self._test_decode('A=1,B=A ==> A+B==2', 'A=1,B=A ==> A+B==2')

def test_decode_crlf_eol_no_trailing_newline(self):
# decode() with eol='\r\n' should not leave a stray \r
# when the input has no trailing line ending.
self._test_decode('abc', 'abc', eol='\r\n')

def test_decode_crlf_eol_multiline_no_trailing_newline(self):
self._test_decode('a\r\nb', 'a\r\nb', eol='\r\n')

def test_decode_crlf_eol_with_trailing_newline(self):
self._test_decode('abc\r\n', 'abc\r\n', eol='\r\n')

def _test_encode(self, body, expected_encoded_body, maxlinelen=None, eol=None):
kwargs = {}
if maxlinelen is None:
Expand Down
Loading