mirror of
https://github.com/python/cpython.git
synced 2025-11-01 18:51:43 +00:00
#18891: Complete new provisional email API.
This adds EmailMessage and, MIMEPart subclasses of Message with new API methods, and a ContentManager class used by the new methods. Also a new policy setting, content_manager. Patch was reviewed by Stephen J. Turnbull and Serhiy Storchaka, and reflects their feedback. I will ideally add some examples of using the new API to the documentation before the final release.
This commit is contained in:
parent
1a16288197
commit
3da240fd01
15 changed files with 2539 additions and 26 deletions
|
|
@ -661,7 +661,7 @@ class TestContentTypeHeader(TestHeaderBase):
|
|||
'text/plain; name="ascii_is_the_default"'),
|
||||
|
||||
'rfc2231_bad_character_in_charset_parameter_value': (
|
||||
"text/plain; charset*=ascii''utf-8%E2%80%9D",
|
||||
"text/plain; charset*=ascii''utf-8%F1%F2%F3",
|
||||
'text/plain',
|
||||
'text',
|
||||
'plain',
|
||||
|
|
@ -669,6 +669,18 @@ class TestContentTypeHeader(TestHeaderBase):
|
|||
[errors.UndecodableBytesDefect],
|
||||
'text/plain; charset="utf-8\uFFFD\uFFFD\uFFFD"'),
|
||||
|
||||
'rfc2231_utf_8_in_supposedly_ascii_charset_parameter_value': (
|
||||
"text/plain; charset*=ascii''utf-8%E2%80%9D",
|
||||
'text/plain',
|
||||
'text',
|
||||
'plain',
|
||||
{'charset': 'utf-8”'},
|
||||
[errors.UndecodableBytesDefect],
|
||||
'text/plain; charset="utf-8”"',
|
||||
),
|
||||
# XXX: if the above were *re*folded, it would get tagged as utf-8
|
||||
# instead of ascii in the param, since it now contains non-ASCII.
|
||||
|
||||
'rfc2231_encoded_then_unencoded_segments': (
|
||||
('application/x-foo;'
|
||||
'\tname*0*="us-ascii\'en-us\'My";'
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue