From 93e647c8de80cdad06a74870a4e271f817d1dfb9 Mon Sep 17 00:00:00 2001 From: Scott Kitterman Date: Sat, 13 Apr 2019 20:53:16 -0400 Subject: [PATCH] Set maxlen to 71 for subsequent lines since we already have a leading space (LP: #1823006), make doctest demonstrate the problem. --- dkim/__init__.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/dkim/__init__.py b/dkim/__init__.py index b98f6b9..c835ba2 100644 --- a/dkim/__init__.py +++ b/dkim/__init__.py @@ -383,8 +383,8 @@ def fold(header, namelen=0): 'x' >>> text(fold(b'xyz'*24)) 'xyzxyzxyzxyzxyzxyzxyzxyzxyzxyzxyzxyzxyzxyzxyzxyzxyzxyzxyzxyzxyzxyzxyzxyz' - >>> len(fold('abxyzxyzxyzxyzxyzxyzxyzxyzxyzxyzxyzxyzxyzxyzxyzxyzxyzxyzxyzxyzxyzxyzxyzxy\\r\\n')) - 78 + >>> len(fold(b'xyz'*48)) + 150 """ # 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). @@ -409,7 +409,7 @@ def fold(header, namelen=0): j = i + 1 pre += header[:i] + b"\r\n " header = header[j:] - maxleng = 72 + maxleng = 71 if len(header) > 2: return pre + header else: