Kaydet (Commit) bd836dfb authored tarafından Barry Warsaw's avatar Barry Warsaw

_split_ascii(): In the clause where curlen + partlen > maxlen, if the

part itself is longer than maxlen, and we aren't already splitting on
whitespace, then we recursively split the part on whitespace and
append that to the this list.
üst f0d35856
......@@ -456,7 +456,14 @@ def _split_ascii(s, firstlen, restlen, continuation_ws, splitchars):
elif curlen + partlen > maxlen:
if this:
lines.append(joiner.join(this) + eol)
this = [part]
# If this part is longer than maxlen and we aren't already
# splitting on whitespace, try to recursively split this line
# on whitespace.
if partlen > maxlen and ch <> ' ':
this = [_split_ascii(part, maxlen, restlen,
continuation_ws, ' ')]
else:
this = [part]
linelen = wslen + partlen
maxlen = restlen
else:
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment