summaryrefslogtreecommitdiffstats
path: root/Lib/email/message.py
Commit message (Collapse)AuthorAgeFilesLines
* #20476: Deal with the message_factory circular import differently.R David Murray2016-09-101-3/+0
| | | | | | | It turns out we can't depend on email.message getting imported every place message_factory is needed, so to avoid a circular import we need to special case Policy.message_factory=None in the parser instead of using monkey patching. I had a feeling that was a bad idea when I did it.
* #20476: add a message_factory policy attribute to email.R David Murray2016-09-091-3/+5
|
* #24277: The new email API is no longer provisional.R David Murray2016-09-081-0/+20
| | | | | | | This is a wholesale reorganization and editing of the email documentation to make the new API the standard one, and the old API the 'legacy' one. The default is still the compat32 policy, for backward compatibility. We will change that eventually.
* Merge: 27988: Make sure iter_attachments does not mutate the payload list.R David Murray2016-09-071-1/+1
|\
| * 27988: Make sure iter_attachments does not mutate the payload list.R David Murray2016-09-071-1/+1
| |
* | Issue #27895: Spelling fixes (Contributed by Ville Skyttä).Raymond Hettinger2016-08-301-1/+1
|/
* Issue #27125: Fix various errors like “will [be] inherited”Martin Panter2016-05-291-1/+1
|
* #21083: add get_content_disposition method to email.message.R David Murray2015-05-161-0/+12
| | | | Patch by Abhilash Raj.
* Issue #23181: More "codepoint" -> "code point".Serhiy Storchaka2015-01-181-1/+1
|\
| * Issue #23181: More "codepoint" -> "code point".Serhiy Storchaka2015-01-181-1/+1
| |
* | Merge: #21091: make is_attachment a method.R David Murray2014-09-201-3/+3
|\ \ | |/
| * #21091: make is_attachment a method.R David Murray2014-09-201-3/+17
|/ | | | | | 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.
* #21079: is_attachment now looks only at the value, ignoring parameters.R David Murray2014-09-201-3/+1
|
* #20976: remove unneeded quopri import in email.utils.R David Murray2014-03-231-1/+2
|
* #11558: Better message if attach called on non-multipart.R David Murray2014-03-061-1/+5
| | | | Original patch by Varun Sharma.
* Merge: #19063: the unicode-in-set_payload problem isn't getting fixed in 3.4.R David Murray2014-02-071-4/+3
|\
| * #19063: the unicode-in-set_payload problem isn't getting fixed in 3.4.R David Murray2014-02-071-4/+3
| |
| * #19063: partially fix set_payload handling of non-ASCII string input.R David Murray2013-12-111-4/+22
| | | | | | | | | | | | This is a backward compatible partial fix, the complete fix requires raising an error instead of accepting the invalid input, so the real fix is only suitable for 3.4.
* | #20531: Apply the 3.3 version of the #19063 fix.R David Murray2014-02-071-4/+22
| | | | | | | | | | So passing unicode to set_payload works again (but still doesn't do what you want when the message is serialized).
* | #20531: Revert e20f98a8ed71, the 3.4 version of the #19063 fix.R David Murray2014-02-071-18/+4
| |
* | #19063: fix set_payload handling of non-ASCII string input.R David Murray2013-12-111-4/+18
| | | | | | | | | | This version of the fix raises an error instead of accepting the invalid input (ie: if a non-ASCII string is used but no charset is specified).
* | Merge #19485: clarify get_param example.R David Murray2013-11-031-1/+1
|\ \ | |/
| * #19485: clarify get_param example.R David Murray2013-11-031-1/+1
| | | | | | | | Patch by Vajrasky Kok.
* | #18891: Complete new provisional email API.R David Murray2013-10-171-5/+211
| | | | | | | | | | | | | | | | | | | | | | | | 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.
* | Merge #18324: set_payload now correctly handles binary input.R David Murray2013-08-221-0/+2
|\ \ | |/
| * #18324: set_payload now correctly handles binary input.R David Murray2013-08-221-0/+2
| | | | | | | | | | | | | | | | | | | | | | This also backs out the previous fixes for for #14360, #1717, and #16564. Those bugs were actually caused by the fact that set_payload didn't decode to str, thus rendering the model inconsistent. This fix does mean the data processed by the encoder functions goes through an extra encode/decode cycle, but it means the model is always consistent. Future API updates will provide a better way to encode payloads, which will bypass this minor de-optimization. Tests by Vajrasky Kok.
* | #18600: add policy to add_string, and as_bytes and __bytes__ methods.R David Murray2013-08-091-8/+36
|/ | | | | | | This was triggered by wanting to make the doctest in email.policy.rst pass; as_bytes and __bytes__ are clearly useful now that we have BytesGenerator. Also updated the Message docs to document the policy keyword that was added in 3.3.
* Merge: Update out of date docstring.R David Murray2012-06-171-7/+5
|\
| * Update out of date docstring.R David Murray2012-06-171-7/+5
| |
* | #10839: raise an error on add of duplicate unique headers in new email policiesR David Murray2012-05-291-0/+10
| | | | | | | | | | | | | | | | | | | | | | This feature was supposed to be part of the initial email6 checkin, but it got lost in my big refactoring. In this patch I'm not providing an easy way to turn off the errors, but they only happen when a header is added programmatically, and it is almost never the right thing to do to allow the duplicate to be added. An application that needs to add duplicates of unique headers can create a policy subclass to allow it.
* | #1672568: email now registers defects for base64 payload format errors.R David Murray2012-05-281-5/+7
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Which also means that it is now producing *something* for any base64 payload, which is what leads to the couple of older test changes in test_email. This is a slightly backward incompatible behavior change, but the new behavior is so much more useful than the old (you can now *reliably* detect errors, and any program that was detecting errors by sniffing for a base64 return from get_payload(decode=True) and then doing its own error-recovery decode will just get the error-recovery decode right away). So this seems to me to be worth the small risk inherent in this behavior change. This patch also refactors the defect tests into a separate test file, since they are no longer just parser tests.
* | #14731: refactor email policy framework.R David Murray2012-05-251-30/+34
|/ | | | | | | | | | | | | | | | | This patch primarily does two things: (1) it adds some internal-interface methods to Policy that allow for Policy to control the parsing and folding of headers in such a way that we can construct a backward compatibility policy that is 100% compatible with the 3.2 API, while allowing a new policy to implement the email6 API. (2) it adds that backward compatibility policy and refactors the test suite so that the only differences between the 3.2 test_email.py file and the 3.3 test_email.py file is some small changes in test framework and the addition of tests for bugs fixed that apply to the 3.2 API. There are some additional teaks, such as moving just the code needed for the compatibility policy into _policybase, so that the library code can import only _policybase. That way the new code that will be added for email6 will only get imported when a non-compatibility policy is imported.
* #11243: tests and fixes for handling of 'dirty data' in additional methodsR David Murray2011-03-171-5/+8
|
* Merge #11555 as_string doc fix from 3.1.R David Murray2011-03-151-2/+1
|\
| * #11555: update doc for 3.x change to as_string mangle_from default.R David Murray2011-03-151-2/+1
| |
| * Merged revisions 87217 via svnmerge fromR. David Murray2010-12-131-3/+21
| | | | | | | | | | | | | | | | | | | | | | | | | | svn+ssh://pythondev@svn.python.org/python/branches/py3k ........ r87217 | r.david.murray | 2010-12-13 18:51:19 -0500 (Mon, 13 Dec 2010) | 5 lines #1078919: make add_header automatically do RFC2231 encoding when needed. Also document the use of three-tuples if control of the charset and language is desired. ........
| * Merged revisions 85130 via svnmerge fromR. David Murray2010-12-061-5/+2
| | | | | | | | | | | | | | | | | | | | svn+ssh://pythondev@svn.python.org/python/branches/py3k ........ r85130 | r.david.murray | 2010-09-30 22:08:02 -0400 (Thu, 30 Sep 2010) | 2 lines Fix a couple spelling errors in comments and delete redundant __len__ def. ........
| * Merged revisions 80078 via svnmerge fromR. David Murray2010-04-141-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | svn+ssh://pythondev@svn.python.org/python/branches/py3k ................ r80078 | r.david.murray | 2010-04-14 14:59:18 -0400 (Wed, 14 Apr 2010) | 9 lines Merged revisions 80062 via svnmerge from svn+ssh://pythondev@svn.python.org/python/trunk ........ r80062 | r.david.murray | 2010-04-13 16:57:40 -0400 (Tue, 13 Apr 2010) | 2 lines Issue #5277: Fix quote counting when parsing RFC 2231 encoded parameters. ........ ................
| * Merged revisions 75307 via svnmerge fromR. David Murray2009-10-101-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | svn+ssh://pythondev@svn.python.org/python/branches/py3k ................ r75307 | r.david.murray | 2009-10-09 20:13:32 -0400 (Fri, 09 Oct 2009) | 12 lines Merged revisions 75301 via svnmerge from svn+ssh://pythondev@svn.python.org/python/trunk ........ r75301 | r.david.murray | 2009-10-09 17:50:54 -0400 (Fri, 09 Oct 2009) | 5 lines Issue #7082: When falling back to the MIME 'name' parameter, the correct place to look for it is the Content-Type header. Patch by Darren Worrall. ........ ................
* | Remove obsolete comment.R David Murray2011-03-151-1/+1
| |
* | #10686: recode non-ASCII headers to 'unknown-8bit' instead of ?s.R. David Murray2011-01-071-12/+13
| | | | | | | | | | | | This applies only when generating strings from non-RFC compliant binary input; it makes the existing recoding behavior more consistent (ie: now no data is lost when recoding).
* | #1693546: don't add quotes around RFC 2231 encoded values.R. David Murray2010-12-241-1/+3
| | | | | | | | | | | | | | | | The RFC is bit hard to understand on this point, but the examples clearly show that parameter values that are encoded according to its charset/language rules don't have surrounding quotes, and the ABNF does not allow for quotes. So when we produce such encoded values, we no longer add quotes.
* | #1078919: make add_header automatically do RFC2231 encoding when needed.R. David Murray2010-12-131-3/+21
| | | | | | | | | | Also document the use of three-tuples if control of the charset and language is desired.
* | #4661: add bytes parsing and generation to email (email version bump to 5.1.0)R. David Murray2010-10-081-26/+72
| | | | | | | | | | | | | | | | The work on this is not 100% complete, but everything is present to allow real-world testing of the code. The only remaining major todo item is to (hopefully!) enhance the handling of non-ASCII bytes in headers converted to unicode by RFC2047 encoding them rather than replacing them with '?'s.
* | Fix a couple spelling errors in comments and delete redundant __len__ def.R. David Murray2010-10-011-5/+2
| |
* | Issue #4770: Restrict binascii module to accept only bytes (as specified).Florent Xicluna2010-07-271-2/+4
| | | | | | | | And fix the email package to encode to ASCII instead of ``raw-unicode-escape`` before ASCII-to-binary decoding.
* | Merged revisions 80062 via svnmerge fromR. David Murray2010-04-141-1/+1
| | | | | | | | | | | | | | | | | | | | svn+ssh://pythondev@svn.python.org/python/trunk ........ r80062 | r.david.murray | 2010-04-13 16:57:40 -0400 (Tue, 13 Apr 2010) | 2 lines Issue #5277: Fix quote counting when parsing RFC 2231 encoded parameters. ........
* | bdecode was already gone in email 5. This merge adds the test fromR. David Murray2010-03-081-1/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | the trunk patch, and removes the last trace of bdecode, which was a commented out call in message.py. Merged revisions 78778 via svnmerge from svn+ssh://pythondev@svn.python.org/python/trunk ........ r78778 | r.david.murray | 2010-03-07 21:04:06 -0500 (Sun, 07 Mar 2010) | 9 lines Issue #7143: get_payload used to strip any trailing newline from a base64 transfer-encoded payload *after* decoding it; it no longer does. email had a special method in utils, _bdecode, specifically to do this, so it must have served a purpose at some point, yet it is clearly wrong per RFC. Fixed with Barry's approval, but no backport. Email package minor version number is bumped, now version 4.0.1. Patch by Joaquin Cuenca Abela. ........
* | Merged revisions 75301 via svnmerge fromR. David Murray2009-10-101-1/+1
|/ | | | | | | | | | | | | svn+ssh://pythondev@svn.python.org/python/trunk ........ r75301 | r.david.murray | 2009-10-09 17:50:54 -0400 (Fri, 09 Oct 2009) | 5 lines Issue #7082: When falling back to the MIME 'name' parameter, the correct place to look for it is the Content-Type header. Patch by Darren Worrall. ........
* Merged revisions 69846 via svnmerge fromMark Dickinson2009-02-211-1/+1
| | | | | | | | | | svn+ssh://pythondev@svn.python.org/python/trunk ........ r69846 | mark.dickinson | 2009-02-21 20:27:01 +0000 (Sat, 21 Feb 2009) | 2 lines Issue #5341: Fix a variety of spelling errors. ........