summaryrefslogtreecommitdiffstats
path: root/Lib/email/test
Commit message (Collapse)AuthorAgeFilesLines
* Merged revisions 86596 via svnmerge fromEzio Melotti2010-11-212-60/+60
| | | | | | | | | | svn+ssh://pythondev@svn.python.org/python/branches/py3k ........ r86596 | ezio.melotti | 2010-11-20 21:04:17 +0200 (Sat, 20 Nov 2010) | 1 line #9424: Replace deprecated assert* methods in the Python test suite. ........
* Merged revisions 85179 via svnmerge fromR. David Murray2010-10-021-0/+18
| | | | | | | | | | | | | | svn+ssh://pythondev@svn.python.org/python/branches/py3k ........ r85179 | r.david.murray | 2010-10-02 11:58:26 -0400 (Sat, 02 Oct 2010) | 6 lines #1050268: make parseaddr 'quote' the contents of quoted strings in addresses. 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. ........
* Merged revisions 85142 via svnmerge fromR. David Murray2010-10-011-0/+6
| | | | | | | | | | | | svn+ssh://pythondev@svn.python.org/python/branches/py3k ........ r85142 | r.david.murray | 2010-10-01 11:40:20 -0400 (Fri, 01 Oct 2010) | 5 lines #10004: in Q encoded word ignore '=xx' when xx is not valid hex. Bug report and fix by Thomas Guettler. ........
* Merged revisions 84310 via svnmerge fromR. David Murray2010-08-251-0/+13
| | | | | | | | | | | | | | | | svn+ssh://pythondev@svn.python.org/python/branches/py3k ........ r84310 | r.david.murray | 2010-08-24 20:45:55 -0400 (Tue, 24 Aug 2010) | 8 lines #1194222: make parsedate always return RFC2822 four character years. 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. ........
* Merged revisions 83690 via svnmerge fromR. David Murray2010-08-042-2/+11
| | | | | | | | | | | | | | | | | svn+ssh://pythondev@svn.python.org/python/branches/py3k ........ r83690 | r.david.murray | 2010-08-03 18:14:10 -0400 (Tue, 03 Aug 2010) | 10 lines #3196: if needed pad a short base64 encoded word before trying to decode. 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. ........
* Merged revisions 82922 via svnmerge fromR. David Murray2010-07-171-0/+33
| | | | | | | | | | | | svn+ssh://pythondev@svn.python.org/python/branches/py3k ........ r82922 | r.david.murray | 2010-07-16 21:19:57 -0400 (Fri, 16 Jul 2010) | 4 lines #1555570: correctly handle a \r\n that is split by the read buffer. Patch and test by Tony Nelson. ........
* #4487: have Charset check with codecs for possible aliases.R. David Murray2010-06-041-0/+3
| | | | | | | | | Previously, unexpected results occurred when email was passed, for example, 'utf8' as a charset name, since email would accept it but would *not* use the 'utf-8' codec for it, even though Python itself recognises that as an alias for utf-8. Now Charset checks with codecs for aliases as well as its own internal table. Issue 8898 has been opened to change this further in py3k so that all aliasing is routed through the codecs module.
* #5610: use \Z not $ so we don't eat extra chars when body part ends with \r\n.R. David Murray2010-06-031-0/+18
| | | | | | | | | | If a body part ended with \r\n, feedparser, using '$' to terminate its search for the newline, would match on the \r\n, and think that it needed to strip two characters in order to account for the line end before the boundary. That made it chop one too many characters off the end of the body part. Using \Z makes the match correct. Patch and test by Tony Nelson.
* #1368247: make set_charset/MIMEText automatically encode unicode _payload.R. David Murray2010-06-021-0/+25
| | | | | | | | Fixes (mysterious, to the end user) UnicodeErrors when using utf-8 as the charset and unicode as the _text argument. Also makes the way in which unicode gets encoded to quoted printable for other charsets more sane (it only worked by accident previously). The _payload now is encoded to the charset.output_charset if it is unicode.
* Issue #7472: remove unused code from email.encoders.encode_7or8bit.R. David Murray2010-05-051-0/+7
| | | | | | | | | 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.
* Bug 7755: audiotest.au is arguably copyrighted material, but definitely makesBarry Warsaw2010-05-051-0/+0
| | | | | Debian unhappy. The actual contents of the audio clip are unimportant, so replace it with something that we know is okay. Guido likes woodpeckers.
* Rephrase comment.Ezio Melotti2010-04-221-2/+2
|
* #8474: fix duplicate test in test_email.Ezio Melotti2010-04-221-5/+0
|
* Issue #5277: Fix quote counting when parsing RFC 2231 encoded parameters.R. David Murray2010-04-131-0/+8
|
* Issue #7143: get_payload used to strip any trailing newline from aR. David Murray2010-03-083-2/+17
| | | | | | | | | | 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.
* Issue 7970: When email.Parser.Parser parses a MIME message of typeR. David Murray2010-02-212-0/+35
| | | | | | | | | | 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.
* Add missing import when running these tests standalone.Georg Brandl2010-02-061-2/+2
|
* #7092: Silence more py3k warnings. Patch by Florent Xicluna.Ezio Melotti2010-02-032-2/+2
|
* Fix issue number in comment.R. David Murray2010-01-161-1/+1
|
* Issue #1670765: Prevent email.generator.Generator from re-wrappingR. David Murray2010-01-162-0/+69
| | | | | | 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.
* Kill a couple of "<>"Antoine Pitrou2010-01-042-4/+4
|
* More yearly updates.Georg Brandl2010-01-011-1/+1
|
* Issue #7082: When falling back to the MIME 'name' parameter, theR. David Murray2009-10-091-4/+2
| | | | | | correct place to look for it is the Content-Type header. Patch by Darren Worrall.
* #2622 Import errors in email.message, from a py2app standalone application.Amaury Forgeot d'Arc2009-07-112-4/+4
| | | | Patch by Mads Kiilerich, Reviewed by Barry Warsaw.
* convert usage of fail* to assert*Benjamin Peterson2009-06-302-90/+90
|
* A fix for issue 1974, inspired by the patch from Andi Albrecht (aalbrecht),Barry Warsaw2009-03-302-56/+74
| | | | | | though with some changes by me. This patch should not be back ported or forward ported. It's a bit too risky for 2.6 and 3.x does things fairly differently.
* fix importBenjamin Peterson2009-03-301-2/+2
|
* update email tests to use SkipTestBenjamin Peterson2009-03-261-2/+2
|
* Revert eol-style to CRLF.Martin v. Löwis2008-06-141-45/+45
|
* Run svneol.py on all sources.Martin v. Löwis2008-06-131-45/+45
|
* Fix issue #1822: MIMEMultipart.is_multipart() behaves correctly for aFacundo Batista2008-01-191-0/+3
| | | | | just-created (and empty) instance. Added tests for this. Thanks Jonathan Share.
* In response to this SF bug:Barry Warsaw2007-07-132-0/+23
| | | | | | | | | | [ 1752723 ] email.message_from_string: initial line gets discarded I added a test to assert that when the first line of text passed to message_from_string() contains a leading space, the message ends up with the appropriate FirstHeaderLineIsContinuationDefect on its defects list. The bug is invalid.
* SF bug #1582282; decode_header() incorrectly splits not-conformant RFCBarry Warsaw2007-03-142-0/+24
| | | | | | | 2047-like headers where there is no whitespace between encoded words. This fix changes the matching regexp to include a trailing lookahead assertion that the closing ?= must be followed by whitespace, newline, or end-of-string. This also changes the regexp to add the MULTILINE flag.
* Patch #1449244: Support Unicode strings inMartin v. Löwis2007-03-131-0/+7
| | | | | email.message.Message.{set_charset,get_content_charset}. Will backport.
* Tokio Kikuchi's fix for SF bug #1629369; folding whitespace allowed in theBarry Warsaw2007-03-122-2/+14
| | | | | | | | | display name of an email address, e.g. Foo \tBar <foo@example.com> Test case added by Barry.
* Forward port some fixes that were in email 2.5 but for some reason didn't makeBarry Warsaw2006-07-262-0/+88
| | | | | | | it into email 4.0. Specifically, in Message.get_content_charset(), handle RFC 2231 headers that contain an encoding not known to Python, or a character in the data that isn't in the charset encoding. Also forward port the appropriate unit tests.
* More RFC 2231 improvements for the email 4.0 package. As Mark Sapiro rightlyBarry Warsaw2006-07-212-22/+242
| | | | | | | | | | | | | | | | | | | | | | | | points out there are really two types of continued headers defined in this RFC (i.e. "encoded" parameters with the form "name*0*=" and unencoded parameters with the form "name*0="), but we were were handling them both the same way and that isn't correct. This patch should be much more RFC compliant in that only encoded params are %-decoded and the charset/language information is only extract if there are any encoded params in the segments. If there are no encoded params then the RFC says that there will be no charset/language parts. Note however that this will change the return value for Message.get_param() in some cases. For example, whereas before if you had all unencoded param continuations you would have still gotten a 3-tuple back from this method (with charset and language == None), you will now get just a string. I don't believe this is a backward incompatible change though because the documentation for this method already indicates that either return value is possible and that you must do an isinstance(val, tuple) check to discriminate between the two. (Yeah that API kind of sucks but we can't change /that/ without breaking code.) Test cases, some documentation updates, and a NEWS item accompany this patch.
* decode_rfc2231(): Be more robust against buggy RFC 2231 encodings.Barry Warsaw2006-07-171-0/+34
| | | | | | | | | | | | | | | | | Specifically, instead of raising a ValueError when there is a single tick in the parameter, simply return that the entire string unquoted, with None for both the charset and the language. Also, if there are more than 2 ticks in the parameter, interpret the first three parts as the standard RFC 2231 parts, then the rest of the parts as the encoded string. Test cases added. Original fewer-than-3-parts fix by Tokio Kikuchi. Resolves SF bug # 1218081. I will back port the fix and tests to Python 2.4 (email 3.0) and Python 2.3 (email 2.5). Also, bump the version number to email 4.0.1, removing the 'alpha' moniker.
* Port forward from 2.4 branch:Barry Warsaw2006-05-012-0/+12
| | | | | | | | | | Patch #1464708 from William McVey: fixed handling of nested comments in mail addresses. E.g. "Foo ((Foo Bar)) <foo@example.com>" Fixes for both rfc822.py and email package. This patch needs to be back ported to Python 2.3 for email 2.5.
* The email module's parsedate_tz function now sets the daylight savingsAnthony Baxter2006-04-032-4/+4
| | | | | | flag to -1 (unknown) since it can't tell from the date whether it should be set. patch from Aldo Cortesi
* Merge email package 4.0 from the sandbox, including documentation, test cases,Barry Warsaw2006-03-184-52/+3235
| | | | and NEWS updates.
* Actually this file should have svn:eol-style CRLF since it's specificallyBarry Warsaw2006-03-041-45/+45
| | | | testing line ending compatibility.
* Set eol-style to native -- doesn't appear to be any reasonTim Peters2006-03-041-45/+45
| | | | for it to claim it has mime-type application/octet-stream.
* Port relevant patches for SF 1409455 to the trunk for email 3.0/Python 2.5.Barry Warsaw2006-02-082-2/+14
| | | | Will port to Python 2.4.
* Resolves SF bug #1423972.Barry Warsaw2006-02-041-2/+4
|
* parsedate_tz(): Minor cleanup.Barry Warsaw2006-02-031-0/+9
| | | | | Port from Python 2.3/email 2.5: Add a test for the tm_yday field is 1 in the return of parsedate().
* SF bug #1347874; FeedParser does not comply with RFC2822.Barry Warsaw2006-01-171-0/+9
| | | | | Change headerRE as suggested in the bug report, so that single character headers are accepted. Test case added too. Will backport to Python 2.4.
* Ported 42075 from release23-maint branch.Barry Warsaw2006-01-172-1/+43
| | | | | | | | | | | SF bug #1403349 solution for email 3.0; some MUAs use the 'file' parameter name in the Content-Distribution header, so Message.get_filename() should fall back to using that. Will port to the Python 2.5 trunk. Also, bump the email package version to 3.0.1 for eventual release. Of course, add a test case too. XXX Need to update the documentation.
* fix broken (unexecuted) testAnthony Baxter2005-06-081-3/+3
|
* Fixes for SF #1076485, which I'll apply to the CVS head too. The problem wasBarry Warsaw2004-12-052-1/+260
| | | | | | | | | | | | | | | | caused by a self._input.readline() call that wasn't checking for the NeedsMoreData marker. msg_43.txt contains a message that illustrates the problem, when email.message_from_*() is called. That interface uses the Parser API, which splits reads into 8192 byte chunks. It so happens that for the test message, the 8192 chunk falls inside a message/delivery-status, which is where in the FeedParser the readline() call was that didn't check for NeedsMoreData. I also added an assert to unreadline() so it'll be more evident if an attempt to push back NeedsMoreData ever happens again. Bump the email package version number.