mirror of
https://github.com/python/cpython.git
synced 2025-08-22 09:45:06 +00:00
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
This commit is contained in:
parent
00b34228bb
commit
8b2af27dae
4 changed files with 10 additions and 34 deletions
|
@ -55,22 +55,6 @@ escapesre = re.compile(r'[][\\()"]')
|
|||
|
||||
# Helpers
|
||||
|
||||
def _identity(s):
|
||||
return s
|
||||
|
||||
|
||||
def _bdecode(s):
|
||||
# We can't quite use base64.encodestring() since it tacks on a "courtesy
|
||||
# newline". Blech!
|
||||
if not s:
|
||||
return s
|
||||
value = base64.decodestring(s)
|
||||
if not s.endswith('\n') and value.endswith('\n'):
|
||||
return value[:-1]
|
||||
return value
|
||||
|
||||
|
||||
|
||||
def formataddr(pair):
|
||||
"""The inverse of parseaddr(), this takes a 2-tuple of the form
|
||||
(realname, email_address) and returns the string value suitable
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue