summaryrefslogtreecommitdiffstats
path: root/Lib/email/Charset.py
diff options
context:
space:
mode:
authorBarry Warsaw <barry@python.org>2003-03-06 05:16:29 (GMT)
committerBarry Warsaw <barry@python.org>2003-03-06 05:16:29 (GMT)
commit784cf6ae8829c3526bf191a511819bc957ab6cd3 (patch)
tree96894ca32fa6c9fbe136e361eaa20a1a7130bd8a /Lib/email/Charset.py
parent0ed81c35a79209405df249921b3382ddef6284ff (diff)
downloadcpython-784cf6ae8829c3526bf191a511819bc957ab6cd3.zip
cpython-784cf6ae8829c3526bf191a511819bc957ab6cd3.tar.gz
cpython-784cf6ae8829c3526bf191a511819bc957ab6cd3.tar.bz2
Merge of the folding-reimpl-branch. Specific changes,
Charset: Alias __repr__ to __str__ for debugging. header_encode(): When calling quopriMIME.header_encode(), set maxlinelen=None so that the lower level function doesn't (also) try to wrap/fold the line.
Diffstat (limited to 'Lib/email/Charset.py')
-rw-r--r--Lib/email/Charset.py6
1 files changed, 4 insertions, 2 deletions
diff --git a/Lib/email/Charset.py b/Lib/email/Charset.py
index a7c08c1..dd328e0 100644
--- a/Lib/email/Charset.py
+++ b/Lib/email/Charset.py
@@ -234,6 +234,8 @@ class Charset:
def __str__(self):
return self.input_charset.lower()
+ __repr__ = __str__
+
def __eq__(self, other):
return str(self) == str(other).lower()
@@ -358,14 +360,14 @@ class Charset:
if self.header_encoding == BASE64:
return email.base64MIME.header_encode(s, cset)
elif self.header_encoding == QP:
- return email.quopriMIME.header_encode(s, cset)
+ return email.quopriMIME.header_encode(s, cset, maxlinelen=None)
elif self.header_encoding == SHORTEST:
lenb64 = email.base64MIME.base64_len(s)
lenqp = email.quopriMIME.header_quopri_len(s)
if lenb64 < lenqp:
return email.base64MIME.header_encode(s, cset)
else:
- return email.quopriMIME.header_encode(s, cset)
+ return email.quopriMIME.header_encode(s, cset, maxlinelen=None)
else:
return s