summaryrefslogtreecommitdiffstats
path: root/Lib/email
Commit message (Collapse)AuthorAgeFilesLines
...
| | * Merged revisions 80795 via svnmerge fromMatthias Klose2010-05-211-0/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | svn+ssh://pythondev@svn.python.org/python/branches/py3k ........ r80795 | barry.warsaw | 2010-05-05 18:18:31 +0200 (Mi, 05 Mai 2010) | 5 lines Bug 7755: audiotest.au is arguably copyrighted material, but definitely makes Debian unhappy. The actual contents of the audio clip are unimportant, so replace it with something that we know is okay. Guido likes woodpeckers. ........
| | * Merged revisions 79996,80855 via svnmerge fromR. David Murray2010-05-062-1/+8
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | svn+ssh://pythondev@svn.python.org/python/branches/py3k ................ r79996 | r.david.murray | 2010-04-12 10:48:58 -0400 (Mon, 12 Apr 2010) | 15 lines Merged revisions 79994 via svnmerge from svn+ssh://pythondev@svn.python.org/python/trunk ........ r79994 | r.david.murray | 2010-04-12 10:26:06 -0400 (Mon, 12 Apr 2010) | 9 lines Issue #7472: ISO-2022 charsets now consistently use 7bit CTE. Fixed a typo in the email.encoders module so that messages output using an ISO-2022 character set will use a content-transfer-encoding of 7bit consistently. Previously if the input data had any eight bit characters the output data would get marked as 8bit even though it was actually 7bit. ........ ................ r80855 | r.david.murray | 2010-05-05 21:41:14 -0400 (Wed, 05 May 2010) | 24 lines Merged revisions 80800 via svnmerge from svn+ssh://pythondev@svn.python.org/python/trunk It turns out that email5 (py3k), because it is using unicode for the payload, doesn't do the encoding to the output character set until later in the process. Specifically, charset.body_encode no longer does the input-to-output charset conversion. So the if test in the exception clause in encoders.encode_7or8bit really is needed in email5. So, this merge only merges the test, not the removal of the 'if'. ........ r80800 | r.david.murray | 2010-05-05 13:31:03 -0400 (Wed, 05 May 2010) | 9 lines Issue #7472: remove unused code from email.encoders.encode_7or8bit. Yukihiro Nakadaira noticed a typo in encode_7or8bit that was trying to special case iso-2022 codecs. It turns out that the code in question is never used, because whereas it was designed to trigger if the payload encoding was eight bit but its output encoding was 7 bit, in practice the payload is always converted to the 7bit encoding before encode_7or8bit is called. Patch by Shawat Anand. ........ ................
| | * Merged revisions 80359 via svnmerge fromEzio Melotti2010-04-221-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | svn+ssh://pythondev@svn.python.org/python/branches/py3k ................ r80359 | ezio.melotti | 2010-04-22 14:57:12 +0300 (Thu, 22 Apr 2010) | 9 lines Merged revisions 80357 via svnmerge from svn+ssh://pythondev@svn.python.org/python/trunk ........ r80357 | ezio.melotti | 2010-04-22 14:53:21 +0300 (Thu, 22 Apr 2010) | 1 line Rephrase comment. ........ ................
| | * Merged revisions 80353 via svnmerge fromEzio Melotti2010-04-221-5/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | svn+ssh://pythondev@svn.python.org/python/branches/py3k ................ r80353 | ezio.melotti | 2010-04-22 14:29:27 +0300 (Thu, 22 Apr 2010) | 9 lines Merged revisions 80350 via svnmerge from svn+ssh://pythondev@svn.python.org/python/trunk ........ r80350 | ezio.melotti | 2010-04-22 14:23:31 +0300 (Thu, 22 Apr 2010) | 1 line #8474: fix duplicate test in test_email. ........ ................
| | * Merged revisions 80078 via svnmerge fromR. David Murray2010-04-142-1/+9
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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 78276 via svnmerge fromR. David Murray2010-02-213-2/+45
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | svn+ssh://pythondev@svn.python.org/python/branches/py3k ................ r78276 | r.david.murray | 2010-02-20 23:39:40 -0500 (Sat, 20 Feb 2010) | 16 lines Merged revisions 78274 via svnmerge from svn+ssh://pythondev@svn.python.org/python/trunk ........ r78274 | r.david.murray | 2010-02-20 23:23:00 -0500 (Sat, 20 Feb 2010) | 9 lines Issue 7970: When email.Parser.Parser parses a MIME message of type message/rfc822 it turns it into an object whose body consists of a list containing a single Message object. HeaderParser, on the other hand, just copies the body as a string. Generator.flatten has a special handler for the message mime type that expected the body to be the one item list. This fails if the message was parsed by HeaderParser. So we now check to see if the body is a string first, and if so just we just emit it. ........ ................
| | * Merged revisions 77542 via svnmerge fromR. David Murray2010-01-163-0/+82
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | svn+ssh://pythondev@svn.python.org/python/branches/py3k ................ r77542 | r.david.murray | 2010-01-16 13:30:03 -0500 (Sat, 16 Jan 2010) | 18 lines Merged revisions 77517,77525 via svnmerge from svn+ssh://pythondev@svn.python.org/python/trunk Merge adds an additional test for as_string with a maxheaderlen specified. ........ r77517 | r.david.murray | 2010-01-16 00:15:17 -0500 (Sat, 16 Jan 2010) | 6 lines Issue #1670765: Prevent email.generator.Generator from re-wrapping headers in multipart/signed MIME parts, which fixes one of the sources of invalid modifications to such parts by Generator. Patch and tests by Martin von Gagern. ........ r77525 | r.david.murray | 2010-01-16 11:08:32 -0500 (Sat, 16 Jan 2010) | 2 lines Fix issue number in comment. ........ ................
| | * Merged revisions 77389 via svnmerge fromBenjamin Peterson2010-01-093-3/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | svn+ssh://pythondev@svn.python.org/python/branches/py3k ................ r77389 | benjamin.peterson | 2010-01-09 12:45:30 -0600 (Sat, 09 Jan 2010) | 25 lines Merged revisions 77209,77229,77359-77360,77371 via svnmerge from svn+ssh://pythondev@svn.python.org/python/trunk ........ r77209 | georg.brandl | 2010-01-01 07:07:05 -0600 (Fri, 01 Jan 2010) | 1 line More yearly updates. ........ r77229 | georg.brandl | 2010-01-02 06:35:01 -0600 (Sat, 02 Jan 2010) | 1 line Fix casing. ........ r77359 | georg.brandl | 2010-01-07 14:54:45 -0600 (Thu, 07 Jan 2010) | 1 line Fix description for Py_GetPath(); it sounded like it always returned sys.path. ........ r77360 | georg.brandl | 2010-01-07 15:48:47 -0600 (Thu, 07 Jan 2010) | 1 line #7653: clarify how the PythonPath registry key should look like. ........ r77371 | senthil.kumaran | 2010-01-08 13:20:25 -0600 (Fri, 08 Jan 2010) | 3 lines Fix for Issue7026. For the Error - RuntimeError: dictionary changed size during iteration ........ ................
| | * Add mktime_tz to __all__. It's documented as being available in email.utils.Barry Warsaw2009-11-251-1/+2
| | |
| | * Merged revisions 75307 via svnmerge fromR. David Murray2009-10-102-5/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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. ........ ................
| | * Merged revisions 73715 via svnmerge fromGeorg Brandl2009-08-131-43/+43
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | svn+ssh://svn.python.org/python/branches/py3k ........ r73715 | benjamin.peterson | 2009-07-01 01:06:06 +0200 (Mi, 01 Jul 2009) | 1 line convert old fail* assertions to assert* ........
| | * Merged revisions 73623-73624 via svnmerge fromBenjamin Peterson2009-06-281-4/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | svn+ssh://pythondev@svn.python.org/python/branches/py3k ................ r73623 | benjamin.peterson | 2009-06-28 12:22:03 -0500 (Sun, 28 Jun 2009) | 58 lines Merged revisions 73004,73439,73496,73509,73529,73564,73576-73577,73595-73596,73605 via svnmerge from svn+ssh://pythondev@svn.python.org/python/trunk ........ r73004 | jeffrey.yasskin | 2009-05-28 22:44:31 -0500 (Thu, 28 May 2009) | 5 lines Fix nearly all compilation warnings under Apple gcc-4.0. Tested with OPT="-g -Wall -Wstrict-prototypes -Werror" in both --with-pydebug mode and --without. There's still a batch of non-prototype warnings in Xlib.h that I don't know how to fix. ........ r73439 | benjamin.peterson | 2009-06-15 19:29:31 -0500 (Mon, 15 Jun 2009) | 1 line don't mask encoding errors when decoding a string #6289 ........ r73496 | vinay.sajip | 2009-06-21 12:37:27 -0500 (Sun, 21 Jun 2009) | 1 line Issue #6314: logging.basicConfig() performs extra checks on the "level" argument. ........ r73509 | amaury.forgeotdarc | 2009-06-22 14:33:48 -0500 (Mon, 22 Jun 2009) | 2 lines #4490 Fix sample code run by "python -m xml.sax.xmlreader" ........ r73529 | r.david.murray | 2009-06-23 13:02:46 -0500 (Tue, 23 Jun 2009) | 4 lines Fix issue 5230 by having pydoc's safeimport check to see if the import error was thrown from itself in order to decide if the module can't be found. Thanks to Lucas Prado Melo for collaborating on the fix and tests. ........ r73564 | amaury.forgeotdarc | 2009-06-25 17:29:29 -0500 (Thu, 25 Jun 2009) | 6 lines #2016 Fix a crash in function call when the **kwargs dictionary is mutated during the function call setup. This even gives a slight speedup, probably because tuple allocation is faster than PyMem_NEW. ........ r73576 | benjamin.peterson | 2009-06-26 18:37:06 -0500 (Fri, 26 Jun 2009) | 1 line document is_declared_global() ........ r73577 | benjamin.peterson | 2009-06-27 09:16:23 -0500 (Sat, 27 Jun 2009) | 1 line link to extensive generator docs in the reference manual ........ r73595 | ezio.melotti | 2009-06-27 18:45:39 -0500 (Sat, 27 Jun 2009) | 1 line stmt and setup can contain multiple statements, see #5896 ........ r73596 | ezio.melotti | 2009-06-27 19:07:45 -0500 (Sat, 27 Jun 2009) | 1 line Fixed a wrong apostrophe ........ r73605 | georg.brandl | 2009-06-28 07:10:18 -0500 (Sun, 28 Jun 2009) | 1 line Remove stray pychecker directive. ........ ................ r73624 | benjamin.peterson | 2009-06-28 12:32:20 -0500 (Sun, 28 Jun 2009) | 1 line document BufferedIOBase.raw and TextIOBase.buffer ................
* | | Merge long Japanese header fix from 3.2.R David Murray2011-03-152-1/+15
|\ \ \ | |/ /
| * | Fix header encoding of long headers when using euc-jp and shift_jis.R David Murray2011-03-152-1/+15
| | | | | | | | | | | | | | | | | | | | | When a header was long enough to need to be split across lines, the input charset name was used instead of the output charset name in the encoded words. This make a difference only for the two charsets above.
* | | Merge linesep docstring changes from 3.2.R David Murray2011-03-142-3/+6
|\ \ \ | |/ /
| * | Harmonize linesep docstrings, and fix the quoting of \r\nR David Murray2011-03-142-3/+6
| | |
| * | Lib/email/test/data/msg_26.txt had its line endings wrong in the SVN repository.Antoine Pitrou2011-03-051-46/+46
| | | | | | | | | | | | (they were probably converted right in working copies through an SVN property)
| * | Add updated .hgeol file and fix newlines in the 3.2 branch.Georg Brandl2011-03-051-46/+46
| | |
* | | #1162477: accept '.' in addition to ':' when parsing time in date header.R David Murray2011-03-142-0/+15
|/ / | | | | | | | | Some non-compliant MUAs use '.'s, so by the Postel Principle we should accept them. Patch by Thomas Herve.
* | #11019: Make BytesGenerator handle Message with None body.R. David Murray2011-01-262-0/+9
| | | | | | | | Bug discovery and initial patch by Victor Stinner.
* | Revert r88197. I'll refix correctly once there is a test.R. David Murray2011-01-261-5/+2
| |
* | Fix BytesGenerator._handle_text() if the message has no payload (None)Victor Stinner2011-01-261-2/+5
| |
* | fix import in email.message_from_binary_file()Victor Stinner2011-01-251-1/+1
| | | | | | | | Parser => BytesParser
* | #5871: protect against header injection attacks.R. David Murray2011-01-092-1/+21
| | | | | | | | | | | | | | | | | | | | | | | | This makes Header.encode throw a HeaderParseError if it winds up formatting a header such that a continuation line has no leading whitespace and looks like a header. Since Header accepts values containing newlines and preserves them (and this is by design), without this fix any program that took user input (say, a subject in a web form) and passed it to the email package as a header was vulnerable to header injection attacks. (As far as we know this has never been exploited.) Thanks to Jakub Wilk for reporting this vulnerability.
* | #10686: recode non-ASCII headers to 'unknown-8bit' instead of ?s.R. David Murray2011-01-074-55/+89
| | | | | | | | | | | | 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).
* | Fix formatting of values with embedded newlines when rfc2047 encodingR. David Murray2011-01-072-3/+21
| | | | | | | | | | | | | | | | | | Before this patch if a value being encoded had an embedded newline, the line following the newline would have no leading whitespace, and the whitespace it did have was encoded into the word. Now the existing whitespace gets turned into a blank, the way it does in other header reformatting, and the _continuation_ws gets added at the beginning of the encoded line.
* | Remove doc for nonexisting parameter.Georg Brandl2011-01-061-3/+1
| |
* | #10790: make append work when output codec is different from input codecR. David Murray2011-01-052-16/+14
| | | | | | | | | | There's still a bug here (the encode call shouldn't use the 'errors' paramter), but I'll fix that later.
* | Fix a comment typo and update another comment to match Python3 realityR. David Murray2010-12-291-2/+2
| |
* | #1693546: don't add quotes around RFC 2231 encoded values.R. David Murray2010-12-242-5/+49
| | | | | | | | | | | | | | | | 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.
* | #1155362: allow hh:mm:ss-uuuu like we allow hh:mm:ss+uuuu in parsedate_tzR. David Murray2010-12-232-1/+13
| | | | | | | | Original patch by Thomas Herve.
* | Fix the change made for issue 1243654.R. David Murray2010-12-212-1/+13
| | | | | | | | Surprisingly, it turns out there was no test that exercised this code path.
* | #9286: Fix the rfc822 parser to preserve whitespace in address local part.R. David Murray2010-12-182-2/+32
| | | | | | | | | | | | | | | | | | | | | | | | Such addresses are not RFC compliant except under the 'obsolete syntax' rules, but before this fix the whitespace was dropped from the input, concatenating the pieces. That breaks one of the principles of the email package, that of preserving the input as much as possible. It also denies the application program the opportunity to apply its own heuristics to interpretation of such non-compliant addresses. It is possible users of the email package were depending on the local part always being a single token, so this fix will not be backported.
* | #1078919: make add_header automatically do RFC2231 encoding when needed.R. David Murray2010-12-132-3/+44
| | | | | | | | | | Also document the use of three-tuples if control of the charset and language is desired.
* | #243654: only create a new MIME boundary if we don't already have one.R. David Murray2010-12-121-12/+6
| | | | | | | | | | | | The rearranged code should do exactly what the old code did, but the new code avoids a potentially costly re computation in the case where a boundary already exists.
* | #8989: add 'domain' keyword to make_msgid.R. David Murray2010-12-022-4/+11
| | | | | | | | Patch by Adrian von Bidder.
* | Fix TestBytesGeneratorIdempotent tests and a couple bugs they revealed.R. David Murray2010-11-212-15/+37
| | | | | | | | | | | | | | | | | | The tests that were failing on (some) windows machines, where the msg_XX.txt files used native \r\n lineseps are now also run on machines that use \n natively, and conversely the \n tests are run on Windows. The failing tests revealed one place where linesep needed to be added to a flatten call in generator. There was also another that the tests didn't catch, so I added a test for that case as well.
* | #9424: Replace deprecated assert* methods in the Python test suite.Ezio Melotti2010-11-201-33/+33
| |
* | Improve TestBytesGeneratorIdempotent using by using linesep.R. David Murray2010-11-201-6/+8
| | | | | | | | | | Also corrects a typo from a previous commit. Unfortunately this does *not* fix issue #10134.
* | Properly close files used by test_email.Brett Cannon2010-10-291-3/+4
| |
* | Properly close a temporary TextIOWrapper in 'email'.Brett Cannon2010-10-291-1/+2
| |
* | #1349106: add linesep argument to generator.flatten and header.encode.R. David Murray2010-10-234-37/+80
| |
* | #4661: add bytes parsing and generation to email (email version bump to 5.1.0)R. David Murray2010-10-086-74/+554
| | | | | | | | | | | | | | | | 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.
* | #1050268: make parseaddr 'quote' the contents of quoted strings in addresses.R. David Murray2010-10-022-2/+25
| | | | | | | | | | | | Also made the doc string for email._parseaddr's 'quote' function more accurate; I'd love to make the function match the old docstring instead, but other code uses it according the existing semantics.
* | Fix docstring typo.R. David Murray2010-10-011-1/+1
| |
* | #10004: in Q encoded word ignore '=xx' when xx is not valid hex.R. David Murray2010-10-012-1/+7
| | | | | | | | Bug report and fix by Thomas Guettler.
* | Fix a couple spelling errors in comments and delete redundant __len__ def.R. David Murray2010-10-011-5/+2
| |
* | #1194222: make parsedate always return RFC2822 four character years.R. David Murray2010-08-252-0/+25
| | | | | | | | | | | | | | | | Two character years are now converted to four character years using the Posix standard rule (<68 == 2000, >=68==1900). This makes the parsed date RFC2822 compliant even if the input is not. Patch and test by Jeffrey Finkelstein.
* | #3196: if needed pad a short base64 encoded word before trying to decode.R. David Murray2010-08-032-1/+13
| | | | | | | | | | | | | | | | | | The RFCs encourage following Postel's law: be liberal in what you accept. So if someone forgot to pad the base64 encoded word payload to an even four bytes, we add the padding before handing it to base64mime.decode. Previously, missing padding resulted in a HeaderParseError. Patch by Jason Williams.
* | Issue #4770: Restrict binascii module to accept only bytes (as specified).Florent Xicluna2010-07-272-4/+6
| | | | | | | | And fix the email package to encode to ASCII instead of ``raw-unicode-escape`` before ASCII-to-binary decoding.