Commit Graph

654 Commits

Author SHA1 Message Date
Robert Collins 19fae1a932 Issue #22932: Fix timezones in email.utils.formatdate.
Patch from Dmitry Shachnev.
2015-08-01 08:19:06 +12:00
Robert Collins 2080dc97a7 Issue #22932: Fix timezones in email.utils.formatdate.
Patch from Dmitry Shachnev.
2015-08-01 08:18:22 +12:00
Raymond Hettinger f070f1cbbc Issue #21448: Improve performance of the email feedparser 2015-05-22 17:23:28 -07:00
Serhiy Storchaka 6baa0a53b0 Issue #6598: Increased time precision and random number range in
email.utils.make_msgid() to strengthen the uniqueness of the message ID.
2015-05-19 10:10:15 +03:00
Serhiy Storchaka ae760c0a2c Issue #6598: Increased time precision and random number range in
email.utils.make_msgid() to strengthen the uniqueness of the message ID.
2015-05-19 10:09:42 +03:00
R David Murray fdb23c2fe5 #20098: add mangle_from_ policy option.
This defaults to True in the compat32 policy for backward compatibility,
but to False for all new policies.

Patch by Milan Oberkirch, with a few tweaks.
2015-05-17 14:24:33 -04:00
R David Murray 224ef3ec3b #24211: Add RFC6532 support to the email library.
This could use more edge case tests, but the basic functionality is tested.
(Note that this changeset does not add tailored support for the RFC 6532
message/global MIME type, but the email package generic facilities will handle
it.)

Reviewed by Maciej Szulik.
2015-05-17 11:29:21 -04:00
R David Murray b744f3a45e #21083: add get_content_disposition method to email.message.
Patch by Abhilash Raj.
2015-05-16 15:41:07 -04:00
Serhiy Storchaka 50ef0f41af Escaped backslashes in docstrings. 2015-04-03 18:13:23 +03:00
Serhiy Storchaka 9f8a8910a4 Escaped backslashes in docstrings. 2015-04-03 18:12:41 +03:00
R David Murray 7d0325d6c8 #23745: handle duplicate MIME parameter names in new parser.
This mimics get_param's error handling for the most part.  It is slightly
better in some regards as get_param can produce some really weird results for
duplicate *0* parts.  It departs from get_param slightly in that if we have a
mix of non-extended and extended pieces for the same parameter name, the new
parser assumes they were all supposed to be extended and concatenates all the
values, whereas get_param always picks the non-extended parameter value.  All
of this error recovery is pretty much arbitrary decisions...
2015-03-29 21:53:05 -04:00
R David Murray c4bb599be0 Merge: #23745: handle duplicate MIME parameter names in new parser. 2015-03-29 21:54:27 -04:00
Serhiy Storchaka 08448a1f4d Issue #23326: Removed __ne__ implementations. Since fixing default __ne__
implementation in issue #21408 they are redundant.
2015-01-31 12:05:05 +02:00
Benjamin Peterson 60a2f49c8c merge 3.4 (#19996) 2015-01-25 23:31:58 -05:00
Benjamin Peterson 155ceaa454 handle headers with no key (closes #19996)
Patch by Cory Benfield.
2015-01-25 23:30:30 -05:00
Serhiy Storchaka 82e07b92b3 Issue #23181: More "codepoint" -> "code point". 2015-01-18 11:33:31 +02:00
Serhiy Storchaka d3faf43f9b Issue #23181: More "codepoint" -> "code point". 2015-01-18 11:28:37 +02:00
R David Murray d2ff243b38 Merge: #21991: make headerregistry params property MappingProxyType. 2014-10-17 19:32:08 -04:00
R David Murray 685b3495e1 #21991: make headerregistry params property MappingProxyType.
It is unlikely anyone is using the fact that the dictionary returned
by the 'params' attribute was previously writable, but even if someone
is the API is provisional so this kind of change is acceptable (and
needed, to get the API "right" before it becomes official).

Patch by Stéphane Wirtel.
2014-10-17 19:30:13 -04:00
R David Murray df75fee9a3 #22508: Drop email __version__ string. It no longer means anything.
A debian code search (by Tshepang Lekhonkhobe) turned up only one package
checking email.__version__...and it was the 2.7-only mailman package.  Since
Barry approves this change, it seems safe enough to make it...
2014-10-03 13:02:47 -04:00
Georg Brandl 1f31583566 merge 3.4 2014-10-02 12:35:54 +02:00
Georg Brandl 529452926b Closes #19434: fix copy-paste error in MIMENonMultipart docstring. 2014-10-02 12:35:08 +02:00
Berker Peksag fe21e4d4d7 Issue #16324: _charset parameter of MIMEText now also accepts email.charset.Charset instances.
Initial patch by Claude Paroz.
2014-09-27 00:57:29 +03:00
R David Murray 7c4093ca95 Merge: #21091: make is_attachment a method. 2014-09-20 18:16:39 -04:00
R David Murray 8a97896a76 #21091: make is_attachment a method.
Since EmailMessage is a provisional API we can fix API bugs in a
maintenance release, but I used a trick suggested by Serhiy to
maintain backward compatibility with 3.4.0/1.
2014-09-20 18:05:28 -04:00
R David Murray 1de0ac05f3 Merge: #21079: is_attachment now looks only at the value, ignoring parameters. 2014-09-20 17:49:48 -04:00
R David Murray 97dfad7856 #21079: is_attachment now looks only at the value, ignoring parameters. 2014-09-20 17:44:53 -04:00
Serhiy Storchaka 1e133cab39 Issue #21448: Fixed FeedParser feed() to avoid O(N**2) behavior when parsing long line.
Original patch by Raymond Hettinger.
2014-08-12 14:00:29 +03:00
Serhiy Storchaka 320a1c0ff7 Issue #21448: Fixed FeedParser feed() to avoid O(N**2) behavior when parsing long line.
Original patch by Raymond Hettinger.
2014-08-12 13:59:11 +03:00
Ezio Melotti c734c387de #20977: merge with 3.4. 2014-08-04 17:17:21 +03:00
Ezio Melotti d577480197 #20977: fix undefined name in the email module. Patch by Rose Ames. 2014-08-04 17:16:49 +03:00
Serhiy Storchaka 465e60e654 Issue #22033: Reprs of most Python implemened classes now contain actual
class name instead of hardcoded one.
2014-07-25 23:36:00 +03:00
R David Murray c6772c4d59 #21476: Unwrap fp in BytesParser so the file isn't unexpectedly closed.
This makes the behavior match that of Parser.  Patch by Vajrasky Kok.
2014-06-26 13:31:43 -04:00
R David Murray e25244657c #21300: Clean up the docs for the email "policy" arguments. 2014-05-06 21:33:18 -04:00
R David Murray 95a8dfb924 #20976: remove unneeded quopri import in email.utils. 2014-03-23 14:18:44 -04:00
Victor Stinner 7fa767e517 Issue #20976: pyflakes: Remove unused imports 2014-03-20 09:16:38 +01:00
R David Murray 5dda12491e #11558: Better message if attach called on non-multipart.
Original patch by Varun Sharma.
2014-03-06 11:44:17 -05:00
R David Murray 66c3d18af1 Merge: #14983: always add a line end after a MIME boundary marker. 2014-02-08 17:56:17 -05:00
R David Murray e9c31470e1 #14983: always add a line end after a MIME boundary marker.
This is more RFC compliant (see issue) and fixes a problem with
signature verifiers rejecting the part when signed.  There is some
amount of backward compatibility concern here since it changes
the output, but the RFC issue coupled with fixing the problem
with signature verifiers seems worth the small risk of breaking
code that depends on the current incorrect output.
2014-02-08 17:54:56 -05:00
R David Murray 01e46ee7e2 Merge: #16983: Apply postel's law to encoded words inside quoted strings. 2014-02-08 13:13:01 -05:00
R David Murray 0400d33928 #16983: Apply postel's law to encoded words inside quoted strings.
This applies only to the new parser.  The old parser decodes encoded words
inside quoted strings already, although it gets the whitespace wrong
when it does so.

This version of the patch only handles the most common case (a single encoded
word surrounded by quotes), but I haven't seen any other variations of this in
the wild yet, so its good enough for now.
2014-02-08 13:12:00 -05:00
R David Murray ff9616bbf7 Merge #19772: Do not mutate message when downcoding to 7bit. 2014-02-08 11:51:18 -05:00
R David Murray 905c8c3d8d #19772: Do not mutate message when downcoding to 7bit.
This is a bit of an ugly hack because of the way generator pieces together the
output message.  The deepcopys aren't too expensive, though, because we know it
is only called on messages that are not multiparts, and the payload (the thing
that could be large) is an immutable object.

Test and preliminary work on patch by Vajrasky Kok.
2014-02-08 11:48:20 -05:00
R David Murray c489e83432 Merge: #17369: Improve handling of broken RFC2231 values in get_filename. 2014-02-07 15:04:26 -05:00
R David Murray 1e949890f6 #17369: Improve handling of broken RFC2231 values in get_filename.
This fixes a regression relative to python2.
2014-02-07 15:02:19 -05:00
R David Murray feb68522fd Merge: #19063: the unicode-in-set_payload problem isn't getting fixed in 3.4. 2014-02-07 13:04:18 -05:00
R David Murray fcc0072380 #19063: the unicode-in-set_payload problem isn't getting fixed in 3.4. 2014-02-07 13:03:08 -05:00
R David Murray 15a693a6f8 #20531: Apply the 3.3 version of the #19063 fix.
So passing unicode to set_payload works again (but still doesn't
do what you want when the message is serialized).
2014-02-07 12:46:17 -05:00
R David Murray 27e9de669b #20531: Revert e20f98a8ed71, the 3.4 version of the #19063 fix. 2014-02-07 12:40:37 -05:00
R David Murray aa21297457 #20476: use EmailMessage as factory if non-compat32 policy is used.
In 3.5 I will fix this right by adding a message_factory attribute
to the policy.
2014-02-07 10:44:16 -05:00