- Clarify the crlf does not count towards line length in fold

(LP: #1823008)
This commit is contained in:
Scott Kitterman
2019-04-13 15:05:04 -04:00
parent c1fec1cca8
commit 118e854889
2 changed files with 7 additions and 1 deletions
+3
View File
@@ -7,6 +7,9 @@ UNRELEASED Version 0.9.2
- Don't log message headers and body unless explicitely requested. This - Don't log message headers and body unless explicitely requested. This
should also reduce memory usage on large messages. (Jonathan should also reduce memory usage on large messages. (Jonathan
Bastien-Filiatrault). Bastien-Filiatrault).
- Clarify the crlf does not count towards line length in fold
(LP: #1823008)
2018-12-09 Version 0.9.1 2018-12-09 Version 0.9.1
- Fixed ARC verification to fail if h= tag is present in Arc-Seal and - Fixed ARC verification to fail if h= tag is present in Arc-Seal and
added tests added tests
+4 -1
View File
@@ -368,7 +368,8 @@ def text(s):
def fold(header, namelen=0): def fold(header, namelen=0):
"""Fold a header line into multiple crlf-separated lines at column 72. """Fold a header line into multiple crlf-separated lines of text at column
72. The crlf does not count for line length.
>>> text(fold(b'foo')) >>> text(fold(b'foo'))
'foo' 'foo'
@@ -382,6 +383,8 @@ def fold(header, namelen=0):
'x' 'x'
>>> text(fold(b'xyz'*24)) >>> text(fold(b'xyz'*24))
'xyzxyzxyzxyzxyzxyzxyzxyzxyzxyzxyzxyzxyzxyzxyzxyzxyzxyzxyzxyzxyzxyzxyzxyz' 'xyzxyzxyzxyzxyzxyzxyzxyzxyzxyzxyzxyzxyzxyzxyzxyzxyzxyzxyzxyzxyzxyzxyzxyz'
>>> len(fold('abxyzxyzxyzxyzxyzxyzxyzxyzxyzxyzxyzxyzxyzxyzxyzxyzxyzxyzxyzxyzxyzxyzxyzxy\\r\\n'))
78
""" """
# 72 is the max line length we actually want, but the header field name # 72 is the max line length we actually want, but the header field name
# has to fit in the first line too (See Debian Bug #863690). # has to fit in the first line too (See Debian Bug #863690).