]> granicus.if.org Git - python/commit
Fixed a bug in the splitting of lines, and improved the splitting for
authorBarry Warsaw <barry@python.org>
Sun, 19 May 2002 23:47:53 +0000 (23:47 +0000)
committerBarry Warsaw <barry@python.org>
Sun, 19 May 2002 23:47:53 +0000 (23:47 +0000)
commit812031b95555e607ccec74f31aabc7601a53ed8a
tree73e28e87412ff38e40104fdece489f49346a2e67
parent8c1aac247667e6ac146e9153cd2941e4c5ec7b09
Fixed a bug in the splitting of lines, and improved the splitting for
single byte character sets.  Also fixed a semantic problem with the
constructor's default arguments.  Specifically,

__init__(): Change the maxlinelen argument default to None instead of
MAXLINELEN.  The semantics should have been (and now are) that if
maxlinelen is given it is always honored.  If it isn't given, but
header_name is given, then the maximum line length is calculated.  If
neither are given then the default 76 characters is used.

_split(): If the character set is a single byte character set then we
can split the line at the maxlinelen because we know that encoding the
header won't increase its length.  If the charset isn't a single byte
charset then we use the quicker divide-and-conquer line splitting
algorithm as before.
Lib/email/Header.py