summaryrefslogtreecommitdiffstats
path: root/Lib/email
Commit message (Collapse)AuthorAgeFilesLines
* #9085: email versions have gotten out of sync, 2.7 is actually 4.0.3.R. David Murray2010-06-261-1/+1
| | | | | | | | In 2.5 the email version was bumped to 4.0.2 just before release but after the maintenance branch was set up. The bump was not backported to trunk, and 2.6 went out the door with a version number of 4.0.1. I bumped this to 4.0.2 because of a behavior change, but that makes it look the same as 2.5. So bump it again to 4.0.3.
* #4487: have Charset check with codecs for possible aliases.R. David Murray2010-06-042-1/+10
| | | | | | | | | 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-032-1/+19
| | | | | | | | | | 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-022-0/+27
| | | | | | | | 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-052-7/+8
| | | | | | | | | 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-132-1/+9
|
* Issue #7472: ISO-2022 charsets now consistently use 7bit CTE.R. David Murray2010-04-121-1/+1
| | | | | | | | 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.
* Issue #7143: get_payload used to strip any trailing newline from aR. David Murray2010-03-085-9/+25
| | | | | | | | | | 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-213-2/+45
| | | | | | | | | | 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-163-0/+80
| | | | | | 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-013-3/+3
|
* Add mktime_tz to __all__. It's documented as being available in email.utils.Barry Warsaw2009-11-251-1/+2
|
* replace has_key with 'in' operatorBenjamin Peterson2009-10-091-7/+7
|
* Issue #7082: When falling back to the MIME 'name' parameter, theR. David Murray2009-10-092-5/+3
| | | | | | 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-116-14/+14
| | | | Patch by Mads Kiilerich, Reviewed by Barry Warsaw.
* convert usage of fail* to assert*Benjamin Peterson2009-06-302-90/+90
|
* Remove stray pychecker directive.Georg Brandl2009-06-281-4/+0
|
* A fix for issue 1974, inspired by the patch from Andi Albrecht (aalbrecht),Barry Warsaw2009-03-303-61/+81
| | | | | | 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
|
* Issue #5341: Fix a variety of spelling errors.Mark Dickinson2009-02-211-1/+1
|
* #2676: email/message.py [Message.get_content_type]: Trivial regex hangs on ↵Antoine Pitrou2008-08-151-7/+11
| | | | pathological input
* Remove a dict.has_key() usage in email._parseaddr found while running -3.Brett Cannon2008-08-031-1/+1
|
* Remove Barry's love of deprecated syntax to silence warnings in the emailBrett Cannon2008-08-036-13/+13
| | | | package, when run under -3, about using <>.
* 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
|
* Patch #2167 from calvin: Remove unused importsChristian Heimes2008-02-232-2/+0
|
* Fix issue #1822: MIMEMultipart.is_multipart() behaves correctly for aFacundo Batista2008-01-192-0/+9
| | | | | 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-143-1/+26
| | | | | | | 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-132-2/+11
| | | | | 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-123-4/+17
| | | | | | | | | display name of an email address, e.g. Foo \tBar <foo@example.com> Test case added by Barry.
* Patch #1634778: add missing encoding aliases for iso8859_15 andGeorg Brandl2007-01-271-0/+3
| | | | iso8859_16.
* decode_rfc2231(): As Christian Robottom Reis points out, it makes no sense toBarry Warsaw2006-10-041-4/+0
| | | | test for parts > 3 when we use .split(..., 2).
* Forward port some fixes that were in email 2.5 but for some reason didn't makeBarry Warsaw2006-07-263-1/+100
| | | | | | | 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-213-41/+277
| | | | | | | | | | | | | | | | | | | | | | | | 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-173-4/+43
| | | | | | | | | | | | | | | | | 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-013-0/+13
| | | | | | | | | | 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-033-5/+6
| | | | | | flag to -1 (unknown) since it can't tell from the date whether it should be set. patch from Aldo Cortesi
* whitespace n11nAnthony Baxter2006-03-201-8/+8
|
* Merge email package 4.0 from the sandbox, including documentation, test cases,Barry Warsaw2006-03-1827-202/+3562
| | | | 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.