summaryrefslogtreecommitdiffstats
path: root/Lib/email/encoders.py
diff options
context:
space:
mode:
authorBarry Warsaw <barry@python.org>2007-08-31 03:04:26 (GMT)
committerBarry Warsaw <barry@python.org>2007-08-31 03:04:26 (GMT)
commit8b2af27dae7c80218c9912052ac1b4c6144ce746 (patch)
tree5dca10b0aa0f7ee88bd3e8eb2f303d994674058d /Lib/email/encoders.py
parent00b34228bb98c378286c0b72a4a4098d5cdd384b (diff)
downloadcpython-8b2af27dae7c80218c9912052ac1b4c6144ce746.zip
cpython-8b2af27dae7c80218c9912052ac1b4c6144ce746.tar.gz
cpython-8b2af27dae7c80218c9912052ac1b4c6144ce746.tar.bz2
More email package fixes.
MIMEApplication() requires a bytes object for its _data, so fix the tests. We no longer need utils._identity() or utils._bdecode(). The former isn't used anywhere AFAICT (where's "make test's" lint? <wink>) and the latter is a kludge that is eliminated by base64.b64encode(). Current status: 5F/5E
Diffstat (limited to 'Lib/email/encoders.py')
-rw-r--r--Lib/email/encoders.py15
1 files changed, 1 insertions, 14 deletions
diff --git a/Lib/email/encoders.py b/Lib/email/encoders.py
index 06016cd..2e77e61 100644
--- a/Lib/email/encoders.py
+++ b/Lib/email/encoders.py
@@ -11,8 +11,8 @@ __all__ = [
'encode_quopri',
]
-import base64
+from base64 import b64encode as _bencode
from quopri import encodestring as _encodestring
@@ -23,19 +23,6 @@ def _qencode(s):
return enc.replace(' ', '=20')
-def _bencode(s):
- # We can't quite use base64.encodestring() since it tacks on a "courtesy
- # newline". Blech!
- if not s:
- return s
- hasnewline = (s[-1] == '\n')
- value = base64.encodestring(s)
- if not hasnewline and value[-1] == '\n':
- return value[:-1]
- return value
-
-
-
def encode_base64(msg):
"""Encode the message's payload in Base64.